REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_ReadFromInitNetcdf.cpp File Reference
#include "REMORA_NCFile.H"
#include "AMReX_FArrayBox.H"
#include "REMORA_DataStruct.H"
Include dependency graph for REMORA_ReadFromInitNetcdf.cpp:

Go to the source code of this file.

Functions

void read_data_from_netcdf (int, const Box &domain, const std::string &fname, FArrayBox &NC_temp_fab, FArrayBox &NC_salt_fab, FArrayBox &NC_xvel_fab, FArrayBox &NC_yvel_fab)
 helper function for reading in initial state data from netcdf
 
void read_data_full_domain_from_netcdf (int, const Box &domain, const std::string &fname, FArrayBox &NC_temp_fab, FArrayBox &NC_salt_fab, FArrayBox &NC_xvel_fab, FArrayBox &NC_yvel_fab, IntVect ngrow)
 helper function for reading in full domain high-resolution initial state data from netcdf
 
void read_zeta_from_netcdf (int, const Box &domain, const std::string &fname, FArrayBox &NC_zeta_fab)
 helper function to read sea surface height from netcdf
 
void read_zeta_full_domain_from_netcdf (int, const Box &domain, const std::string &fname, FArrayBox &NC_zeta_fab, IntVect ngrow)
 helper function to read high-resolution full-domain sea surface height from netcdf
 
void read_bathymetry_from_netcdf (int, const Box &domain, const std::string &fname, FArrayBox &NC_h_fab)
 helper function to read bathymetry from netcdf
 
void read_grid_vars_from_netcdf (int, const Box &domain, const std::string &fname, FArrayBox &NC_pm_fab, FArrayBox &NC_pn_fab, FArrayBox &NC_xr_fab, FArrayBox &NC_yr_fab, FArrayBox &NC_xu_fab, FArrayBox &NC_yu_fab, FArrayBox &NC_xv_fab, FArrayBox &NC_yv_fab, FArrayBox &NC_xp_fab, FArrayBox &NC_yp_fab)
 helper function to read grid variables from netcdf
 
bool read_spherical_grid_vars_from_netcdf (int, const Box &domain, const std::string &fname, FArrayBox &NC_lonp_fab, FArrayBox &NC_latp_fab)
 helper function to read optional spherical psi coordinates from netcdf
 
void read_bathymetry_full_domain_from_netcdf (const Box &domain, const std::string &fname, FArrayBox &NC_h_fab, IntVect ngrow)
 helper function to read full-domain high resolution bathymetry from netcdf
 
void read_grid_vars_full_domain_from_netcdf (const Box &domain, const std::string &fname, FArrayBox &NC_pm_fab, FArrayBox &NC_pn_fab, IntVect ngrow)
 helper function to read full-domain high resolution grid variables from netcdf
 
void read_coriolis_from_netcdf (int, const Box &domain, const std::string &fname, FArrayBox &NC_fcor_fab)
 helper function to read coriolis factor from netcdf
 
void read_masks_from_netcdf (int, const Box &domain, const std::string &fname, FArrayBox &NC_mskr_fab, FArrayBox &NC_msku_fab, FArrayBox &NC_mskv_fab)
 helper function for reading in land-sea masks from netcdf
 
void read_clim_nudg_coeff_from_netcdf (int, const Box &domain, const std::string &fname, bool do_m2_clim_nudg, bool do_m3_clim_nudg, bool do_temp_clim_nudg, bool do_salt_clim_nudg, FArrayBox &NC_M2NC_fab, FArrayBox &NC_M3NC_fab, FArrayBox &NC_TempNC_fab, FArrayBox &NC_SaltNC_fab)
 helper function to read climatology nudging from netcdf
 
void read_vec_from_netcdf (int, const amrex::Vector< std::string > &fnames, const std::string &field_name, amrex::Vector< int > &vec_dat)
 helper function to read in vector of data from netcdf
 

Function Documentation

◆ read_bathymetry_from_netcdf()

void read_bathymetry_from_netcdf ( int  lev,
const Box &  domain,
const std::string &  fname,
FArrayBox &  NC_h_fab 
)

helper function to read bathymetry from netcdf

Parameters
levlevel of data to read
domainsimulation domain
fnamefile name to read from
NC_h_fabcontainer for bathymetry data

Definition at line 129 of file REMORA_ReadFromInitNetcdf.cpp.

Referenced by REMORA::init_bathymetry_from_netcdf().

Here is the caller graph for this function:

◆ read_bathymetry_full_domain_from_netcdf()

void read_bathymetry_full_domain_from_netcdf ( const Box &  domain,
const std::string &  fname,
FArrayBox &  NC_h_fab,
IntVect  ngrow 
)

helper function to read full-domain high resolution bathymetry from netcdf

Parameters
domainsimulation domain at nc_hires_grid_level
fnamefile name to read from
NC_h_fabcontainer for bathymetry data
ngrownumber of grow cells to read in, if not default

Definition at line 241 of file REMORA_ReadFromInitNetcdf.cpp.

Referenced by REMORA::init_bathymetry_full_domain_from_netcdf().

Here is the caller graph for this function:

◆ read_clim_nudg_coeff_from_netcdf()

void read_clim_nudg_coeff_from_netcdf ( int  lev,
const Box &  domain,
const std::string &  fname,
bool  do_m2_clim_nudg,
bool  do_m3_clim_nudg,
bool  do_temp_clim_nudg,
bool  do_salt_clim_nudg,
FArrayBox &  NC_M2NC_fab,
FArrayBox &  NC_M3NC_fab,
FArrayBox &  NC_TempNC_fab,
FArrayBox &  NC_SaltNC_fab 
)

helper function to read climatology nudging from netcdf

Parameters
levlevel of data to read
domainsimulation domain
fnamefile name to read from
do_m2_clim_nudgwhether to do 2d momentum climatology nudging
do_m3_clim_nudgwhether to do 3d momentum climatology nudging
do_temp_clim_nudgwhether to do temperature climatology nudging
do_salt_clim_nudgwhether to do salinity climatology nudging
NC_M2NC_fabcontainer for 2d momentum climatology data
NC_M3NC_fabcontainer for 3d momentum climatology data
NC_TempNC_fabcontainer for temperature climatology data
NC_SaltNC_fabcontainer for salinity climatology data

Definition at line 351 of file REMORA_ReadFromInitNetcdf.cpp.

Referenced by REMORA::init_clim_nudg_coeff_from_netcdf().

Here is the caller graph for this function:

◆ read_coriolis_from_netcdf()

void read_coriolis_from_netcdf ( int  lev,
const Box &  domain,
const std::string &  fname,
FArrayBox &  NC_fcor_fab 
)

helper function to read coriolis factor from netcdf

Parameters
levlevel of data to read
domainsimulation domain
fnamefile name to read from
NC_fcor_fabcontainer for Coriolis parameter data

Definition at line 290 of file REMORA_ReadFromInitNetcdf.cpp.

Referenced by REMORA::init_coriolis_from_netcdf().

Here is the caller graph for this function:

◆ read_data_from_netcdf()

void read_data_from_netcdf ( int  ,
const Box &  domain,
const std::string &  fname,
FArrayBox &  NC_temp_fab,
FArrayBox &  NC_salt_fab,
FArrayBox &  NC_xvel_fab,
FArrayBox &  NC_yvel_fab 
)

helper function for reading in initial state data from netcdf

Parameters
levlevel of data to read
domainsimulation domain
fnamefile name to read from
NC_temp_fabcontainer for temperature data
NC_salt_fabcontainer for salinity data
NC_u_fabcontainer for u velocity data
NC_v_fabcontainer for v velocity data

Definition at line 18 of file REMORA_ReadFromInitNetcdf.cpp.

Referenced by REMORA::init_data_from_netcdf().

Here is the caller graph for this function:

◆ read_data_full_domain_from_netcdf()

void read_data_full_domain_from_netcdf ( int  ,
const Box &  domain,
const std::string &  fname,
FArrayBox &  NC_temp_fab,
FArrayBox &  NC_salt_fab,
FArrayBox &  NC_xvel_fab,
FArrayBox &  NC_yvel_fab,
IntVect  ngrow 
)

helper function for reading in full domain high-resolution initial state data from netcdf

Parameters
levlevel of data to read
domainsimulation domain
fnamefile name to read from
NC_temp_fabcontainer for temperature data
NC_salt_fabcontainer for salinity data
NC_u_fabcontainer for u velocity data
NC_v_fabcontainer for v velocity data
ngrownumber of grow cells to read

Definition at line 50 of file REMORA_ReadFromInitNetcdf.cpp.

Referenced by REMORA::init_data_full_domain_from_netcdf().

Here is the caller graph for this function:

◆ read_grid_vars_from_netcdf()

void read_grid_vars_from_netcdf ( int  lev,
const Box &  domain,
const std::string &  fname,
FArrayBox &  NC_pm_fab,
FArrayBox &  NC_pn_fab,
FArrayBox &  NC_xr_fab,
FArrayBox &  NC_yr_fab,
FArrayBox &  NC_xu_fab,
FArrayBox &  NC_yu_fab,
FArrayBox &  NC_xv_fab,
FArrayBox &  NC_yv_fab,
FArrayBox &  NC_xp_fab,
FArrayBox &  NC_yp_fab 
)

helper function to read grid variables from netcdf

Parameters
levlevel of data to read
domainsimulation domain
fnamefile name to read from
NC_pm_fabcontainer for pm data
NC_pn_fabcontainer for pn data
NC_xr_fabcontainer for x_rho data
NC_yr_fabcontainer for y_rho data
NC_xu_fabcontainer for x_u data
NC_yu_fabcontainer for y_u data
NC_xv_fabcontainer for x_v data
NC_yv_fabcontainer for y_v data
NC_xp_fabcontainer for x_p data
NC_yp_fabcontainer for y_p data

Definition at line 162 of file REMORA_ReadFromInitNetcdf.cpp.

Referenced by REMORA::init_grid_vars_from_netcdf().

Here is the caller graph for this function:

◆ read_grid_vars_full_domain_from_netcdf()

void read_grid_vars_full_domain_from_netcdf ( const Box &  domain,
const std::string &  fname,
FArrayBox &  NC_pm_fab,
FArrayBox &  NC_pn_fab,
IntVect  ngrow 
)

helper function to read full-domain high resolution grid variables from netcdf

Parameters
levlevel of data to read
domainsimulation domain
fnamefile name to read from
NC_pm_fabcontainer for pm data
NC_pn_fabcontainer for pn data
ngrownumber of grow cells to read in, if not default

Definition at line 266 of file REMORA_ReadFromInitNetcdf.cpp.

Referenced by REMORA::init_grid_vars_full_domain_from_netcdf().

Here is the caller graph for this function:

◆ read_masks_from_netcdf()

void read_masks_from_netcdf ( int  ,
const Box &  domain,
const std::string &  fname,
FArrayBox &  NC_mskr_fab,
FArrayBox &  NC_msku_fab,
FArrayBox &  NC_mskv_fab 
)

helper function for reading in land-sea masks from netcdf

Parameters
levlevel of data to read
domainsimulation domain
fnamefile name to read from
NC_mskr_fabcontainer for rho-point land/sea mask data
NC_msku_fabcontainer for u-point land/sea mask data
NC_mskv_fabcontainer for v-point land/sea mask data

Definition at line 316 of file REMORA_ReadFromInitNetcdf.cpp.

Referenced by REMORA::init_masks_from_netcdf().

Here is the caller graph for this function:

◆ read_spherical_grid_vars_from_netcdf()

bool read_spherical_grid_vars_from_netcdf ( int  lev,
const Box &  domain,
const std::string &  fname,
FArrayBox &  NC_lonp_fab,
FArrayBox &  NC_latp_fab 
)

helper function to read optional spherical psi coordinates from netcdf

Parameters
domainsimulation domain
fnamefile name to read from
NC_lonp_fabcontainer for lon_psi data
NC_latp_fabcontainer for lat_psi data
Returns
whether the file carried spherical psi coordinates and they were read

ROMS grid files for spherical grids carry lon_psi/lat_psi alongside x_psi/y_psi, and those degree-valued corner arrays are what a coupled driver needs when the two components do not share a projected Cartesian frame (SCRIP/COAWST selects the same way; see Lib/SCRIP_COAWST/read_roms.f). Idealized grid files carry no spherical coordinates, so this read is optional and reports whether it happened rather than aborting.

Definition at line 207 of file REMORA_ReadFromInitNetcdf.cpp.

Referenced by REMORA::init_grid_vars_from_netcdf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_vec_from_netcdf()

void read_vec_from_netcdf ( int  lev,
const amrex::Vector< std::string > &  fnames,
const std::string &  field_name,
amrex::Vector< int > &  vec_dat 
)

helper function to read in vector of data from netcdf

Parameters
levlevel of data to read
fnamesfile name(s) to read from
field_namefield name to read
vec_datvector to fill data

Definition at line 392 of file REMORA_ReadFromInitNetcdf.cpp.

Referenced by REMORA::init_riv_pos_from_netcdf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_zeta_from_netcdf()

void read_zeta_from_netcdf ( int  lev,
const Box &  domain,
const std::string &  fname,
FArrayBox &  NC_zeta_fab 
)

helper function to read sea surface height from netcdf

Parameters
levlevel of data to read
domainsimulation domain
fnamefile name to read from
NC_zeta_fabcontainer for sea surface height data

Definition at line 79 of file REMORA_ReadFromInitNetcdf.cpp.

Referenced by REMORA::init_zeta_from_netcdf().

Here is the caller graph for this function:

◆ read_zeta_full_domain_from_netcdf()

void read_zeta_full_domain_from_netcdf ( int  lev,
const Box &  domain,
const std::string &  fname,
FArrayBox &  NC_zeta_fab,
IntVect  ngrow 
)

helper function to read high-resolution full-domain sea surface height from netcdf

Parameters
levlevel of data to read
domainsimulation domain
fnamefile name to read from
NC_zeta_fabcontainer for sea surface height data
ngrownumber of grow cells to read in, if not default

Definition at line 104 of file REMORA_ReadFromInitNetcdf.cpp.

Referenced by REMORA::init_zeta_full_domain_from_netcdf().

Here is the caller graph for this function: