Skip to content

Commit 7881c97

Browse files
committed
new nearest_lat mapalgo in cdeps - does not requre a mesh
1 parent ed80c85 commit 7881c97

3 files changed

Lines changed: 33 additions & 3 deletions

File tree

bld/namelist_files/namelist_defaults_cam.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,6 +2012,9 @@
20122012

20132013
<!-- co2 surface source (overwrite co2_diag sent to land and ocean) -->
20142014
<co2_surface_source>.false.</co2_surface_source>
2015+
<co2_surface_source_mapalgo>nearest_lat</co2_surface_source_mapalgo>
2016+
<co2_surface_source_mesh_filename>none</co2_surface_source_mesh_filename>
2017+
<co2_surface_source_lat_dimname>lat</co2_surface_source_lat_dimname>
20152018

20162019
<!-- nitrogen deposition to surface components -->
20172020
<stream_ndep_varlist>NDEP_NHx_month:NDEP_NOy_month</stream_ndep_varlist>

bld/namelist_files/namelist_definition.xml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10297,10 +10297,22 @@ Default: path
1029710297
If TRUE, set co2_diag sent to land and ocean to value read from co2_surface_source_data_filename
1029810298
Default: FALSE
1029910299
</entry>
10300+
<entry id="co2_surface_source_mapalgo" type="char*256" category="CO2 surface source"
10301+
group="co2_surface_source_stream_nl" valid_values="nearest_lat,bilinear,consf" >
10302+
Mapping algorithm to map co2 data to model grid. Nearest lat assumes
10303+
that a mesh file is not needed and that the forcing data is lat/time or lat/lev/time.
10304+
In this case the mesh is set to none.
10305+
Default: nearest_lat
10306+
</entry>
10307+
<entry id="stream_co2_surface_source_lat_dimname" type="char*256" input_pathname="abs" category="CO2 surface source"
10308+
group="co2_surface_source_stream_nl" valid_values="" >
10309+
Latitude dimension name on stream_co2_surface_source_data_filename. Only used if co2_surface_source_mapalgo is 'nearest_lat'
10310+
Default: lat
10311+
</entry>
1030010312
<entry id="stream_co2_surface_source_mesh_filename" type="char*256" input_pathname="abs" category="CO2 surface source"
1030110313
group="co2_surface_source_stream_nl" valid_values="" >
10302-
Grid mesh file corresponding to stream_co2_surface_source_data_filename.
10303-
Must be set by user.
10314+
Grid mesh file corresponding to stream_co2_surface_source_data_filename.
10315+
Default: none
1030410316
</entry>
1030510317
<entry id="stream_co2_surface_source_data_filename" type="char*256" input_pathname="abs" category="CO2 surface source"
1030610318
group="co2_surface_source_stream_nl" valid_values="" >

src/cpl/nuopc/atm_stream_co2.F90

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ module atm_stream_co2
2727
type(shr_strdata_type) :: sdat_co2_surface_source ! input data stream
2828

2929
! namelist variables
30+
character(len=CL) :: stream_co2_surface_source_mapalgo
31+
character(len=CL) :: stream_co2_surface_source_lat_dimname
3032
character(len=CL) :: stream_co2_surface_source_mesh_filename
3133
character(len=CL) :: stream_co2_surface_source_data_filename
3234
character(len=CL) :: stream_co2_surface_source_data_varname ! variable name for co2_surface_source on stream file(s)
@@ -72,6 +74,8 @@ subroutine stream_co2_surface_source_readnl(nlfile)
7274

7375
! Default values for namelist
7476
co2_surface_source = .false.
77+
stream_co2_surface_source_mapalgo = 'none'
78+
stream_co2_surface_source_lat_dimname = 'lat'
7579
stream_co2_surface_source_data_filename = ' '
7680
stream_co2_surface_source_mesh_filename = ' '
7781
stream_co2_surface_source_data_varname = ' '
@@ -111,6 +115,12 @@ subroutine stream_co2_surface_source_readnl(nlfile)
111115
if (ierr /= 0) call endrun(trim(subname)//": FATAL: mpi_bcast: co2_surface_source")
112116

113117
if (co2_surface_source) then
118+
call mpi_bcast(stream_co2_surface_source_mapalgo, &
119+
len(stream_co2_surface_source_mapalgo), mpi_character, masterprocid, mpicom, ierr)
120+
if (ierr /= 0) call endrun(trim(subname)//": FATAL: mpi_bcast: stream_co2_surface_source_mapalgo")
121+
call mpi_bcast(stream_co2_surface_source_lat_dimname, &
122+
len(stream_co2_surface_source_lat_dimname), mpi_character, masterprocid, mpicom, ierr)
123+
if (ierr /= 0) call endrun(trim(subname)//": FATAL: mpi_bcast: stream_co2_surface_source_lat_dimname")
114124
call mpi_bcast(stream_co2_surface_source_mesh_filename, &
115125
len(stream_co2_surface_source_mesh_filename), mpi_character, masterprocid, mpicom, ierr)
116126
if (ierr /= 0) call endrun(trim(subname)//": FATAL: mpi_bcast: stream_co2_surface_source_mesh_filename")
@@ -137,6 +147,10 @@ subroutine stream_co2_surface_source_readnl(nlfile)
137147
write(iulog,'(a)') ' '
138148
if (co2_surface_source) then
139149
write(iulog,'(2a)') subname,' co2 surface source override settings::'
150+
write(iulog,'(3a)') subname,' stream_co2_surface_source_mapalgo = ',&
151+
trim(stream_co2_surface_source_mapalgo)
152+
write(iulog,'(3a)') subname,' stream_co2_surface_source_lat_dimname = ',&
153+
trim(stream_co2_surface_source_lat_dimname)
140154
write(iulog,'(3a)') subname,' stream_co2_surface_source_data_filename = ',&
141155
trim(stream_co2_surface_source_data_filename)
142156
write(iulog,'(3a)') subname,' stream_co2_surface_source_mesh_filename = ',&
@@ -188,12 +202,13 @@ subroutine stream_co2_surface_source_init(rc)
188202
stream_fldlistFile = (/stream_co2_surface_source_data_varname/), &
189203
stream_fldListModel = (/stream_co2_surface_source_data_varname/), &
190204
stream_lev_dimname = 'null', &
191-
stream_mapalgo = 'bilinear', &
205+
stream_mapalgo = trim(stream_co2_surface_source_mapalgo), &
192206
stream_offset = 0, &
193207
stream_taxmode = trim(stream_co2_surface_source_taxmode), &
194208
stream_dtlimit = 1.0e30_r8, &
195209
stream_tintalgo = 'linear', &
196210
stream_name = 'CO2_SURFACE_SOURCE data ', &
211+
stream_lat_dimname = trim(stream_co2_surface_source_lat_dimname), &
197212
rc = rc)
198213
if (ChkErr(rc,__LINE__,u_FILE_u)) return
199214

0 commit comments

Comments
 (0)