Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f74be0a
General infrastructure changes for COSP-RTTOV.
jshaw35 Jun 8, 2024
f0b147a
Kitchen sink of cospsimulator_intr changes. Everything needed for RTT…
jshaw35 Jun 8, 2024
76818e6
Move assignment of allcld_ice and allcld_liq values
jshaw35 Aug 19, 2024
9005548
Merge tag 'cam6_4_097' into cam6_3_144_cosprttov
jshaw35 Jun 30, 2025
1db8f04
Remove initials, change inequality checks to modern fortran, remove o…
jshaw35 Jun 30, 2025
920045d
Prepend COSP-related namelist fields with "cosp_" and add more comple…
jshaw35 Jun 30, 2025
fa1e764
update imports and Makefile following COSPv2.0 reorg
jshaw35 Jul 8, 2025
5334bfe
Correct COSP utils path in Makefile
jshaw35 Jul 9, 2025
da5fa8b
Update cosp2 repo information for git fleximod
jshaw35 Jul 9, 2025
8e47f70
Address error in CESM build with COSP but not RTTOV.
jshaw35 Jul 9, 2025
2c433f0
Change cosp2 git fleximod reference to a stable hash following recomm…
jshaw35 Jul 9, 2025
7f3a24c
Missed correction
jshaw35 Jul 9, 2025
04adadb
Update cospsimulator_intr.F90 logic to work with new namelist variables.
jshaw35 Jul 16, 2025
aeb8df3
Correct allocation and assignment of cospstateIN%hgt_matrix_half. Pe…
jshaw35 Jul 16, 2025
496a7ec
Clean up print statement
jshaw35 Jul 16, 2025
7015d6b
Merge branch 'cam_development' into cam6_3_144_cosprttov
jshaw35 Jul 16, 2025
d2adfcc
At logic to masking that allows for swaths to work correctly.
jshaw35 Jul 16, 2025
a318f50
Revert "Clean up print statement"
jshaw35 Jul 16, 2025
4287774
Revert "Merge pull request #1343 from jimmielin/hplin/vdiff_answer_ch…
jshaw35 Jul 16, 2025
8b021fb
Revert changes for comparison of swathed fields.
jshaw35 Jul 16, 2025
7124d23
Clean up print statements
jshaw35 Jul 16, 2025
57e6fb4
Correct cld_cal_un outfld call to outside of if statement
jshaw35 Jul 17, 2025
fef0719
Update COSPv.20 tag
jshaw35 Jul 17, 2025
a5c4c17
Merge tag 'cam6_4_106' into cam6_3_144_cosprttov
jshaw35 Aug 5, 2025
1579bbd
Revert diffusion_solver and ChangeLog
jshaw35 Aug 5, 2025
e799da1
Change request for CAM PR
jshaw35 Aug 5, 2025
c90094c
Merge branch 'cam_development' into cam6_3_144_cosprttov
jshaw35 Sep 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@
fxDONOTUSEurl = https://github.com/MPAS-Dev/MPAS-Model.git

[submodule "cosp2"]
path = src/physics/cosp2/src
url = https://github.com/CFMIP/COSPv2.0
path = src/physics/cosp2/src
url = https://github.com/dustinswales/COSPv2.0
fxrequired = AlwaysRequired
fxsparse = ../.cosp_sparse_checkout
Comment on lines +103 to 105
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to brought into an official COSP repo - it can not be on a personal fork

fxtag = v2.1.4cesm
fxDONOTUSEurl = https://github.com/CFMIP/COSPv2.0
fxtag = e2afae9
fxDONOTUSEurl = https://github.com/dustinswales/COSPv2.0

[submodule "clubb"]
path = src/physics/clubb
Expand Down
8 changes: 8 additions & 0 deletions bld/config_files/definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,14 @@ Switch to enable building COSP simulator package. 1 => build COSP.
<entry id="cosp_libdir" value="">
Directory containing COSP library.
</entry>
<entry id="rttov" valid_values="0,1" value="0">
Switch to enable building the RTTOV radiative transfer model. With COSP.
1 => link COSP with RTTOV with building.
</entry>
<entry id="rttov_libdir" value="">
Directory containing RTTOV libraries. For example:
/glade/u/home/jonahshaw/w/RTTOV2/hdfseries_build/lib/
Comment on lines +300 to +301
Copy link
Collaborator

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.

</entry>
<entry id="fv3core_libdir" value="">
Directory containing FV3CORE library.
</entry>
Expand Down
29 changes: 29 additions & 0 deletions bld/configure
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ OPTIONS
-co2_cycle This option modifies the CAM configuration by
increasing the number of advected constituents by 4.
-cosp Enable the COSP simulator.
-rttov Enable RTTOV within the COSP simulator.
-rttov_libdir <str>A string containing a path to the RTTOV install.
-cppdefs <string> A string of user specified CPP defines. Appended to
Makefile defaults. E.g. -cppdefs '-DVAR1 -DVAR2'
-cpl Coupling framework [mct | nuopc]. Default: mct.
Expand Down Expand Up @@ -244,6 +246,8 @@ GetOptions(
"co2_cycle" => \$opts{'co2_cycle'},
"cosp" => \$opts{'cosp'},
"cosp_libdir=s" => \$opts{'cosp_libdir'},
"rttov" => \$opts{'rttov'},
"rttov_libdir=s" => \$opts{'rttov_libdir'},
"cppdefs=s" => \$opts{'cppdefs'},
"cpl=s" => \$opts{'cpl'},
"debug" => \$opts{'debug'},
Expand Down Expand Up @@ -1023,6 +1027,22 @@ if (defined $opts{'cosp'}) {
}
my $cosp = $cfg_ref->get('cosp');

# Option to build COSP with RTTOV
if ($cosp and defined $opts{'rttov'} and defined $opts{'rttov_libdir'}) {
$cfg_ref->set('rttov', $opts{'rttov'});
$cfg_ref->set('rttov_libdir', $opts{'rttov_libdir'});
print "COSP-RTTOV enabled$eol";
}
elsif ( $cosp and defined $opts{'rttov'}) {
$cfg_ref->set('rttov', $opts{'rttov'});
}
elsif ( defined $opts{'rttov'} ) {
die "configure ERROR: rttov defined but cosp undefined. cosp_libdir also undefined \n";
}

my $rttov = $cfg_ref->get('rttov');
my $rttov_libdir = $cfg_ref->get('rttov_libdir');

# cosp is only implemented with the cam5, cam6, and cam7 physics packages
if ($cosp and ($phys_pkg ne 'cam5' and $phys_pkg ne 'cam6' and $phys_pkg ne 'cam7')) {
die "configure ERROR: cosp not implemented for the $phys_pkg physics package \n";
Expand Down Expand Up @@ -1888,6 +1908,15 @@ if ($cosp) {
die "** Could not create the cosp build directory: $bld_dir\n";
}

# Turn on RTTOV if passed the keyword. The cosp-rttov Makefile copies rttov libraries to the $cosp_libdir path
if ($rttov) {
# Current version when copying the RTTOV libraries for each build (both HDF5 and openmp are successfully linked now):
$ldflags .= " -L$cosp_libdir -lrttov13_wrapper -lrttov13_mw_scatt -lrttov13_brdf_atlas -lrttov13_emis_atlas -lrttov13_other -lrttov13_parallel -lrttov13_coef_io -lrttov13_hdf -lrttov13_main ";
# Let the RTTOV libraries stay where they are:
# A more functional code would read these from Makefile.rttov in the COSP2 directory in CAM instead of hardcoding, but I don't know how to do that yet.
$cfg_ref->set('ldflags', $ldflags);
print "Adding rttov libraries as dependencies in ldflags.\n";
}
# Create the COSP Makefile from a template and copy it into the cosp bld directory
if ($print) { print "creating $cosp_libdir/Makefile\n"; }
write_cosp_makefile("$cfgdir/../src/physics/cosp2/Makefile.in", "$cosp_libdir/Makefile");
Expand Down
172 changes: 172 additions & 0 deletions bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2461,6 +2461,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"
Expand All @@ -2470,6 +2479,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 +2500 to +2501
Copy link
Collaborator

Choose a reason for hiding this comment

The 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)

Copy link
Author

Choose a reason for hiding this comment

The 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"
Expand Down
Loading