-
Notifications
You must be signed in to change notification settings - Fork 173
COSP-RTTOV integration with CAM #1327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: cam_development
Are you sure you want to change the base?
Changes from 40 commits
f74be0a
f0b147a
76818e6
9005548
1db8f04
920045d
fa1e764
5334bfe
da5fa8b
8e47f70
2c433f0
7f3a24c
04adadb
aeb8df3
496a7ec
7015d6b
d2adfcc
a318f50
4287774
8b021fb
7124d23
57e6fb4
fef0719
a5c4c17
1579bbd
e799da1
c90094c
3d22bce
6984db6
cbbc65a
95110d2
7343973
f6c158b
b0b90eb
41a032a
d79c714
baa77f2
4a8eaec
b5bb6a3
b5de26e
ce734cd
d2044bb
4a5dcac
e3b510e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2454,6 +2454,15 @@ will be saved. | |
| Default: FALSE | ||
| </entry> | ||
|
|
||
| <entry id="cosp_lrttov_sim" type="logical" category="cosp" | ||
| group="cospsimulator_nl" valid_values=""> | ||
| If true, RTTOV simulator will be run and output | ||
| will be saved according to the appropriate RTTOV | ||
| instrument namelist files in "rttov_instrument_namelists". | ||
|
|
||
| Default: FALSE | ||
| </entry> | ||
|
|
||
| <!-- COSP input control parameters --> | ||
|
|
||
| <entry id="cosp_ncolumns" type="integer" category="cosp" | ||
|
|
@@ -2463,6 +2472,169 @@ This default logical is set in cospsimulator_intr.F90 | |
| Default: 50 | ||
| </entry> | ||
|
|
||
| <entry id="cosp_rttov_Ninstruments" type="integer" category="cosp" | ||
| group="cospsimulator_nl" valid_values=""> | ||
| Number of RTTOV instruments to simulate. | ||
| This default logical is set in cospsimulator_intr.F90 | ||
| Default: 0 | ||
| </entry> | ||
|
|
||
| <entry id="cosp_rttov_instrument_namelists" type="char*256(50)" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| List of RTTOV instrument namelist files to read when running RTTOV in COSP. | ||
| File paths are read relative to the case run directory | ||
| (e.g. /glade/derecho/scratch/$USER/$CASENAME/run/). Each namelist file | ||
| contains information specifying the simulated instrument, channels, and | ||
| outputs. Templates and instructions can be found in the COSP-RTTOV | ||
| code repository. | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <!-- Swathing input control parameters. --> | ||
| <entry id="cosp_N_SWATHS_ISCCP" type="integer*10" category="cosp" | ||
|
Comment on lines
+2493
to
+2494
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. During documentation of this feature, could we add a section on how to set up your own satellite (if it is easily done)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| group="cospsimulator_nl" valid_values="" > | ||
| Number of satellite sampling swaths used to mask COSP ISCCP data. | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_N_SWATHS_MISR" type="integer*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Number of satellite sampling swaths used to mask COSP MISR data. | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_N_SWATHS_MODIS" type="integer*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Number of satellite sampling swaths used to mask COSP MODIS data. | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_N_SWATHS_CSCAL" type="integer*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Number of satellite sampling swaths used to mask COSP CloudSat-CALIPSO data. | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_N_SWATHS_PARASOL" type="integer*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Number of satellite sampling swaths used to mask COSP PARASOL data. | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_N_SWATHS_ATLID" type="integer*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Number of satellite sampling swaths used to mask COSP ATLID data. | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_SWATH_LOCALTIMES_ISCCP" type="real*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Swath localtimes (hours) for masking COSP ISCCP data. The sampling | ||
| "local time" refers to a linear shift from UTC as a function of a | ||
| gridcell’s longitude (t_local = t_UTC − longitude * 24/360). | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_SWATH_LOCALTIMES_MISR" type="real*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Swath localtimes (hours) for masking COSP MISR data. The sampling | ||
| "local time" refers to a linear shift from UTC as a function of a | ||
| gridcell’s longitude (t_local = t_UTC − longitude * 24/360). | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_SWATH_LOCALTIMES_MODIS" type="real*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Swath localtimes (hours) for masking COSP MODIS data. The sampling | ||
| "local time" refers to a linear shift from UTC as a function of a | ||
| gridcell’s longitude (t_local = t_UTC − longitude * 24/360). | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_SWATH_LOCALTIMES_CSCAL" type="real*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Swath localtimes (hours) for masking COSP CloudSat-CALIPSO data. The | ||
| sampling "local time" refers to a linear shift from UTC as a function of a | ||
| gridcell’s longitude (t_local = t_UTC − longitude * 24/360). | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_SWATH_LOCALTIMES_PARASOL" type="real*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Swath localtimes (hours) for masking COSP PARASOL data. The sampling | ||
| "local time" refers to a linear shift from UTC as a function of a | ||
| gridcell’s longitude (t_local = t_UTC − longitude * 24/360). | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_SWATH_LOCALTIMES_ATLID" type="real*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Swath localtimes (hours) for masking COSP ATLID data. The sampling | ||
| "local time" refers to a linear shift from UTC as a function of a | ||
| gridcell’s longitude (t_local = t_UTC − longitude * 24/360). | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_SWATH_WIDTHS_ISCCP" type="real*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Swath widths (kilometers) for masking COSP ISCCP data. The "swath width" | ||
| determines the spatial region around each local time that is simulated. | ||
| Supplying a swath width in units of distance rather than radians produces | ||
| a larger sampling density at higher latitudes that is consistent with | ||
| observations. | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_SWATH_WIDTHS_MISR" type="real*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Swath widths (kilometers) for masking COSP MISR data. The "swath width" | ||
| determines the spatial region around each local time that is simulated. | ||
| Supplying a swath width in units of distance rather than radians produces | ||
| a larger sampling density at higher latitudes that is consistent with | ||
| observations. | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_SWATH_WIDTHS_MODIS" type="real*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Swath widths (kilometers) for masking COSP MODIS data. The "swath width" | ||
| determines the spatial region around each local time that is simulated. | ||
| Supplying a swath width in units of distance rather than radians produces | ||
| a larger sampling density at higher latitudes that is consistent with | ||
| observations. | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_SWATH_WIDTHS_CSCAL" type="real*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Swath widths (kilometers) for masking COSP CSCAL data. The "swath width" | ||
| determines the spatial region around each local time that is simulated. | ||
| Supplying a swath width in units of distance rather than radians produces | ||
| a larger sampling density at higher latitudes that is consistent with | ||
| observations. | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_SWATH_WIDTHS_PARASOL" type="real*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Swath widths (kilometers) for masking COSP PARASOL data. The "swath width" | ||
| determines the spatial region around each local time that is simulated. | ||
| Supplying a swath width in units of distance rather than radians produces | ||
| a larger sampling density at higher latitudes that is consistent with | ||
| observations. | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <entry id="cosp_SWATH_WIDTHS_ATLID" type="real*10" category="cosp" | ||
| group="cospsimulator_nl" valid_values="" > | ||
| Swath widths (kilometers) for masking COSP ATLID data. The "swath width" | ||
| determines the spatial region around each local time that is simulated. | ||
| Supplying a swath width in units of distance rather than radians produces | ||
| a larger sampling density at higher latitudes that is consistent with | ||
| observations. | ||
| Default: none | ||
| </entry> | ||
|
|
||
| <!-- COSP output parameters --> | ||
|
|
||
| <entry id="cosp_histfile_num" type="integer" category="cosp" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,7 +71,7 @@ def _build_fms(caseroot, libroot, bldroot): | |
|
|
||
| ############################################################################### | ||
| def _build_cam(caseroot, libroot, bldroot): | ||
| ############################################################################### | ||
| ############################################################################### | ||
|
|
||
| with Case(caseroot, read_only=False) as case: | ||
|
|
||
|
|
@@ -91,15 +91,40 @@ def _build_cam(caseroot, libroot, bldroot): | |
| except: | ||
| raise RuntimeError("CAM's 'buildcpp' script failed to run properly.") | ||
|
|
||
| #-------------------------------------------------------- | ||
| # Check if RTTOV is being requested by the user, | ||
| # and if so, set a needed environment variable | ||
| # and update the CAM_LINKED_LIBS list: | ||
| #-------------------------------------------------------- | ||
|
|
||
| env_vars = '' | ||
| config_opts = case.get_value("CAM_CONFIG_OPTS") | ||
|
|
||
| if "-rttov" in config_opts: | ||
| # Set environment variable needed by COSP Makefile | ||
| env_vars = "env RTTOV=true " | ||
|
|
||
| hdf5_lib_path = os.environ.get("NCAR_LDFLAGS_HDF5") | ||
|
|
||
| # Add HDF5 library to CAM linked library list: | ||
| linked_libs = case.get_value("CAM_LINKED_LIBS", | ||
| subgroup="build_component_cam") | ||
| hdf5_link_opts = f"-L{hdf5_lib_path}" | ||
| hdf5_link_opts += " -lhdf5_fortran -lhdf5_hl_fortran -lhdf5" | ||
| case.set_value("CAM_LINKED_LIBS", | ||
| linked_libs + hdf5_link_opts) | ||
|
|
||
|
|
||
| with Case(caseroot) as case: | ||
|
|
||
| casetools = case.get_value("CASETOOLS") | ||
| srcroot = case.get_value("SRCROOT") | ||
| gmake_j = case.get_value("GMAKE_J") | ||
| gmake = case.get_value("GMAKE") | ||
| mach = case.get_value("MACH") | ||
| casetools = case.get_value("CASETOOLS") | ||
| srcroot = case.get_value("SRCROOT") | ||
| gmake_j = case.get_value("GMAKE_J") | ||
| gmake = case.get_value("GMAKE") | ||
| mach = case.get_value("MACH") | ||
| config_opts = case.get_value("CAM_CONFIG_OPTS") | ||
| user_incldir = None | ||
| cam_dycore = case.get_value("CAM_DYCORE") | ||
| cam_dycore = case.get_value("CAM_DYCORE") | ||
| if cam_dycore == "fv3": | ||
| slr = os.path.abspath(case.get_value("SHAREDLIBROOT")) | ||
| compiler = case.get_value("COMPILER") | ||
|
|
@@ -138,14 +163,32 @@ def _build_cam(caseroot, libroot, bldroot): | |
| expect(os.path.isfile(libfms), "FMS library not found {}".format(libfms)) | ||
| shutil.copy(libfms, libroot) | ||
|
|
||
| #-------------------------------------------------------- | ||
|
||
| # Check if RTTOV is being requested by the user, | ||
| # and if so, set a needed environment variable | ||
| # and update the CAM_LINKED_LIBS list: | ||
| #-------------------------------------------------------- | ||
|
|
||
| #env_vars = '' | ||
| #if "-rttov" in config_opts: | ||
| # Set environment variable needed by COSP Makefile | ||
| # env_vars = "env RTTOV=true " | ||
|
|
||
| # Add HDF5 library to CAM linked library list: | ||
| # hdf5_link_opts = "-L$(NCAR_LDFLAGS_HDF5)" | ||
| # hdf5_link_opts += " -lhdf5_fortran -lhdf5_hl_fortran -lhdf5" | ||
| # case.set_value("CAM_LINKED_LIBS", | ||
| # case.get_value("CAM_LINKED_LIBS") + hdf5_link_opts) | ||
|
|
||
| # ------------------------------------------------------- | ||
| # build the library | ||
| # ------------------------------------------------------- | ||
| complib = os.path.join(libroot, "libatm.a") | ||
| makefile = os.path.join(casetools, "Makefile") | ||
|
|
||
| cmd = "{} complib -j {} COMP_NAME=cam COMPLIB={} -f {} {} ".format( | ||
| gmake, gmake_j, complib, makefile, get_standard_makefile_args(case) | ||
| cmd = "{}{} complib -j {} COMP_NAME=cam COMPLIB={} -f {} {} ".format( | ||
| env_vars, gmake, gmake_j, complib, makefile, | ||
| get_standard_makefile_args(case) | ||
| ) | ||
| if cam_cppdefs: | ||
| cmd += " USER_CPPDEFS='{}'".format(cam_cppdefs) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should install the library in a TBD location on derecho.