override co2 surface source to send to land/ocean#294
Conversation
|
@tjiputra - I think I've implemented the behavior you wanted in NorESMhub/NorESM#825. |
|
@mvertens - thank you. Should i test this on beta22 or other specific branch? Using pr-noresm3_0_beta22 branch, I got this error during case.build: |
|
@tjiputra - yes - please test this on beta22. However, this code is still in a PR status #294. For you to test this - you need to do the following edit .gitmodules to have the following Then you can run the following That should give you the CAM code you need. Please let me know if this is working for you. |
|
@mvertens - But the run crashes: (shr_stream_verifyTCoord) ERROR: calendar dates must be increasing Case directory (Olivia): |
|
@tjiputra - I had not tested the 1pctCO2 and I have you the wrong namelist: If this does not work - I'll try to duplicate the problem and resolve it. |
|
@mvertens - the same error occurs again. It seems that it tries to read and cycle the first year even if I set stream_co2_surface_source_year_first = 0 |
|
@tjiputra - that's very odd. I'll track this down. Sorry you ran into this. |
|
@tjiputra - the problem is not in the code - it's in the dataset. I generated a time coordinate for this dataset and it seems to have duplicated the first year: |
|
@tjiputra - I have fixed this file on olivia and tested that the following user_nl_cam works: |
gold2718
left a comment
There was a problem hiding this comment.
I have several clean-up and documentation requests as well as some bug fixes and safety features.
| </entry> | ||
| <entry id="stream_ndep_taxmode" type="char*256" category="Nitrogen Deposition" | ||
| group="ndep_stream_nl" valid_values="cycle,extend,limit" > | ||
| time extrapolation mode. |
There was a problem hiding this comment.
Please add documentation similar to other xxx_taxmode namelist variables:
| time extrapolation mode. | |
| Time extrapolation algorithm to use for stream_ndep_data_filename. | |
| - cycle: Simply cycle through the available model data (i.e., start over when the end is reached) | |
| - extend: Use the final value when end of data is reached. | |
| - limit: Halt the model run if the model time exceeds the available data. | |
| Default: extend for transient, otherwise cycle |
| </entry> | ||
| <entry id="stream_co2_surface_source_mesh_filename" type="char*256" input_pathname="abs" category="CO2 surface source" | ||
| group="co2_surface_source_stream_nl" valid_values="" > | ||
| Grid mesh file corresponding to sream_co2_surface_source_data_filename. |
There was a problem hiding this comment.
typo
| Grid mesh file corresponding to sream_co2_surface_source_data_filename. | |
| Grid mesh file corresponding to stream_co2_surface_source_data_filename. |
| </entry> | ||
| <entry id="stream_co2_surface_source_data_filename" type="char*256" input_pathname="abs" category="CO2 surface source" | ||
| group="co2_surface_source_stream_nl" valid_values="" > | ||
| co2 stream data filename. |
There was a problem hiding this comment.
| co2 stream data filename. | |
| Data source file for reading CO2 concentrations to be passed to the surface if co2_surface_source=.true. |
| </entry> | ||
| <entry id="stream_co2_surface_source_data_varname" type="char*256" category="CO2 surface source" | ||
| group="co2_surface_source_stream_nl" valid_values="" > | ||
| co2 varname on stream data file(s). |
There was a problem hiding this comment.
| co2 varname on stream data file(s). | |
| Variable name for reading CO2 concentrations in stream_co2_surface_source_data_filename. |
| ! error check | ||
| if ( trim(stream_co2_surface_source_taxmode) /= 'cycle' .and. & | ||
| trim(stream_co2_surface_source_taxmode) /= 'extend' .and. & | ||
| trim(stream_co2_surface_source_taxmode) /= 'limit') then | ||
| call endrun(subName//': ERROR stream_co2_surface_source_taxmode '& | ||
| //trim(stream_co2_surface_source_taxmode)& | ||
| //' must be either cycle, extend or limit') | ||
| end if |
There was a problem hiding this comment.
Since stream_co2_surface_source_taxmode is broadcast, can this error check be moved into the logic below or inside the if (masterproc) logic where the namelist is read?
| integer, intent(out) :: rc | ||
|
|
||
| ! local variables | ||
| character(*), parameter :: subName = "('stream_co2_surface_source_init')" |
There was a problem hiding this comment.
Please use correct syntax:
| character(*), parameter :: subName = "('stream_co2_surface_source_init')" | |
| character(len=*), parameter :: subName = "('stream_co2_surface_source_init')" |
| integer :: nml_error ! namelist i/o error flag | ||
| integer :: ierr ! error status | ||
| integer :: nf ! field counter | ||
| character(*), parameter :: subName = "('stream_co2_surface_source_readnl')" |
There was a problem hiding this comment.
Please use correct syntax:
| character(*), parameter :: subName = "('stream_co2_surface_source_readnl')" | |
| character(len=*), parameter :: subName = "('stream_co2_surface_source_readnl')" |
| integer :: sec ! seconds into current date for nstep+1 | ||
| integer :: mcdate ! Current model date (yyyymmdd) | ||
| real(r8), pointer :: dataptr1d(:) | ||
| character(*), parameter :: subName = "('stream_co2_surface_source_interp')" |
There was a problem hiding this comment.
Please use correct syntax:
| character(*), parameter :: subName = "('stream_co2_surface_source_interp')" | |
| character(len=*), parameter :: subName = "('stream_co2_surface_source_interp')" |
| if (ierr /= 0) call endrun(trim(subname)//": FATAL: mpi_bcast: stream_ndep_year_align") | ||
|
|
||
| ! Determine if ndep stream is active, and if not return | ||
| call mpi_bcast(stream_ndep_data_filename, len(stream_ndep_data_filename), mpi_character, 0, mpicom, ierr) |
There was a problem hiding this comment.
See comment in atm_stream_co2.F90 but make sure that all broadcasts are happening from the correct MPI task:
| call mpi_bcast(stream_ndep_data_filename, len(stream_ndep_data_filename), mpi_character, 0, mpicom, ierr) | |
| call mpi_bcast(stream_ndep_data_filename, len(stream_ndep_data_filename), mpi_character, mstrid, mpicom, ierr) |
Summary: New ability to have co2 sent to land/ocean be different than used in radiation/chemistry
Purpose of changes: address ability to run the experiments outlined in NorESMhub/NorESM#825
Changes made to build system: None
Changes made to the namelist: New namelist group co2_surface_source_stream_nl
To activate this behavior edit user_nl_clm to have the following:
If you want to send 1pct CO2 to land/ocean:
NOTE: a new namelist was also introduced for nitrogen deposition -
stream_ndep_taxmodeChanges to the defaults for the boundary datasets: None
Substantial timing or memory changes: None
Detailed description of changes:
The above custom namelists must be set in user_nl_cam - there are no out of the box defaults.
The 1850 and 1pct CO2 files in
$DIN_LOC_ROOT/atm/waccm/lb/cmip7_ghg_version20260607/only had [lat,time] dimensions - and CDEPS cannot work with such files. As a result - 20deg longitude datasets were created for the above scenarios.Verified that using the following compset 1
at
ne16pg3_tn14- the co2 diag field sent to the ocean had the expected behavior that was different than the co2 being used internally for the radiation in CAM.