Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Can cpl read in data at runtime ?

Mikasa

sky
Member
Hello, I am using CESM 2.1.3.

In my experiment design, I want the cpl to read in data on the disk to replace the variable value calculated by the cpl. And the replacement should be performed at each flux calculation in the cpl.

I know the cpl can output data, but i haven't found any infomation about how cpl load in external data.
Is there any subroutines off the shelf in the CIME src ?

Thanks for your help and patience.
 

jedwards

CSEG and Liaisons
Staff member
You will need to design and implement suitable code to read the data from your file and
replace the flux calculation. There is no out of the box capacity to do this.
 

Mikasa

sky
Member
You will need to design and implement suitable code to read the data from your file and
replace the flux calculation. There is no out of the box capacity to do this.
Thanks for your prompt reply!The main problem is how to read in the nc file in cpl. Is there any out of the box subroutines to do this ? I mean the code to read and parse variables from NC files. Compared to read in file, the replacement is much easier.
 

jedwards

CSEG and Liaisons
Staff member
You would use pio to do that in parallel - see for example code in cime/src/drivers/mct/main/seq_hist_mod.F90
 

Mikasa

sky
Member
You would use pio to do that in parallel - see for example code in cime/src/drivers/mct/main/seq_hist_mod.F90
Hello, I have been reading the source code of the driver, including the seq_hist_mod.F90 recently. I want to control some of the fluxes from atm to ocn, so I plan to read in the CESM history nc file from another case to modify the value of xao%Faox_lat, xao%Faox_lat, and Faox_taux, etc in the new case. I find that the cpl use the seq_io_write in seq_io.mod to write hisory file as following:
interface seq_io_read
module procedure seq_io_read_av
module procedure seq_io_read_avs
module procedure seq_io_read_avscomp
module procedure seq_io_read_int
module procedure seq_io_read_int1d
module procedure seq_io_read_r8
module procedure seq_io_read_r81d
module procedure seq_io_read_char
end interface seq_io_read
interface seq_io_write
module procedure seq_io_write_av
module procedure seq_io_write_avs
module procedure seq_io_write_avscomp
module procedure seq_io_write_int
module procedure seq_io_write_int1d
module procedure seq_io_write_r8
module procedure seq_io_write_r81d
module procedure seq_io_write_char
module procedure seq_io_write_time
end interface seq_io_write
But I want to read the 3D array (with lat, lon, time dims) from nc file. It seems that the seq_io_read can not handle it. So how can I do that ?

Thank you very much for answering my question!
 
Top