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

How to use my own forcing data to drive CLM single site simulation.

Status
Not open for further replies.

jinmuluo

Jinmu Luo
Member
Hi all,

I have a series of meteorology observations near the interested site, I want to use it to drive the CLM single-site model. So I'm wondering does anyone knows how to incorporate it into the model? I have some specific questions below.
(1) My meteorology observation is in one hour step, csv file. Do I need to transfer it into .nc file or does CLM have any subroutine that can read csv files?
(2) I also have some soil temperature observations, I know the soil temperature does not belong to climate-forcing inputs, so how can I use this observation?

Best,

Jinmu
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
1) You will have to transfer it into a netcdf file, the data atmosphere (datm) doesn't read csv files.
2) You could compare the observation of soil temperature to that in the model (TSOI in the history files). Match the depth of the observation to the depth of the closest soil layer in the model, or interpolate.
 

jinmuluo

Jinmu Luo
Member
1) You will have to transfer it into a netcdf file, the data atmosphere (datm) doesn't read csv files.
2) You could compare the observation of soil temperature to that in the model (TSOI in the history files). Match the depth of the observation to the depth of the closest soil layer in the model, or interpolate.
Hi Keith,

Thanks for you suggestions! I take a look at the met files CLM needs, it looks like the time step is three hours for all variables, can I input other time resolution data like 1 hours ?

Best,
 

jinmuluo

Jinmu Luo
Member
1) You will have to transfer it into a netcdf file, the data atmosphere (datm) doesn't read csv files.
2) You could compare the observation of soil temperature to that in the model (TSOI in the history files). Match the depth of the observation to the depth of the closest soil layer in the model, or interpolate.
Another two questions:
(1) I don't have the incident longwave radiation, does this variable is optional?
(2) Can I use relative humidity to replace specific humidity?

Thanks !
 

slevis

Moderator
Staff member
I searched the Forums with this string "flds" and found this thread with some answers:

Also, the model should be able to handle different time resolutions in the datm input data.

And, I am not sure if the model will recognize and work with rel. humidity (RH) instead of sp. humidity. Feel free to try this and/or look in the code and report back. If not, you may wish to convert the RH data to sp. humidity.
 

jinmuluo

Jinmu Luo
Member
Hi Keith,

When I tried to input my meteorology files into the CLM, I met such error report. Could you please take a look at this error? I'm not sure I doing everything right.

the case is in cheyenne: /glade/work/jinmuluo/MESOCOM

----------------------------------------------------------


finish the setup


Building case in directory /glade/work/jinmuluo/MESOCOM


sharedlib_only is False


model_only is False


Setting resource.RLIMIT_STACK to -1 from (307200000, -1)


Generating component namelists as part of build


2023-07-21 11:09:07 atm


Create namelist for component datm


Calling /glade/u/home/jinmuluo/ctsm-fanv3-merges/components/cdeps/datm/cime_config/buildnml


ERROR: input stream mod can only be of the form streamname:var=value(s)
 

slevis

Moderator
Staff member
Based on the ERROR, if I were you, I would first look at my input stream mod file and see how the form differs from `streamname:var=value(s)`
 

jinmuluo

Jinmu Luo
Member
Based on the ERROR, if I were you, I would first look at my input stream mod file and see how the form differs from `streamname:var=value(s)`
Hi Sam,

I have created my own forcing dataset, what streamname I can use?

example of my user_nl_datm_streams
--------------------------------------------------------------------------------

CLMGSWP3v1.Solar:year_first=2014
CLMGSWP3v1.Solar:year_last=2022
CLMGSWP3v1.Solar:year_align=2014
CLMGSWP3v1.Solar:datafiles = /glade/scratch/jinmuluo/MESOCOM_fluxtower_BOOI4/datmdata/clmforc.BOOI4.Solr.isu_point.2014-01.nc,\

/glade/scratch/jinmuluo/MESOCOM_fluxtower_BOOI4/datmdata/clmforc.BOOI4.Solr.isu_point.2014-02.nc,\

/glade/scratch/jinmuluo/MESOCOM_fluxtower_BOOI4/datmdata/clmforc.BOOI4.Solr.isu_point.2014-03.nc,\

/glade/scratch/jinmuluo/MESOCOM_fluxtower_BOOI4/datmdata/clmforc.BOOI4.Solr.isu_point.2014-04.nc,\

/glade/scratch/jinmuluo/MESOCOM_fluxtower_BOOI4/datmdata/clmforc.BOOI4.Solr.isu_point.2014-05.nc,\

/glade/scratch/jinmuluo/MESOCOM_fluxtower_BOOI4/datmdata/clmforc.BOOI4.Solr.isu_point.2014-06.nc,\
 

slevis

Moderator
Staff member
I'm comparing your example to an example that I posted here (step 6). One difference I see is that I didn't use new lines after each datafile. I made one continuous line without spaces or newlines.
 

jinmuluo

Jinmu Luo
Member
I'm comparing your example to an example that I posted here (step 6). One difference I see is that I didn't use new lines after each datafile. I made one continuous line without spaces or newlines.
Thank you, I guess the mistake I've made was I forgot to delete the "\" before the next "CLMGSWP3v1.Precip:year_first=2014" which confused the model. And after I compiled the model and send it into Cheyenne queue, it gave me some errors I've never met before. Could you please help me to take a look at it?

Thank you.
 

jinmuluo

Jinmu Luo
Member
Thank you, I guess the mistake I've made was I forgot to delete the "\" before the next "CLMGSWP3v1.Precip:year_first=2014" which confused the model. And after I compiled the model and send it into Cheyenne queue, it gave me some errors I've never met before. Could you please help me to take a look at it?

Thank you.
cesm.log

Obtained 10 stack frames.
/glade/scratch/jinmuluo/MESOCOM/bld/cesm.exe() [0x11ab589]
/glade/scratch/jinmuluo/MESOCOM/bld/cesm.exe() [0x11ab537]
/glade/scratch/jinmuluo/MESOCOM/bld/cesm.exe() [0x11aab68]
/glade/scratch/jinmuluo/MESOCOM/bld/cesm.exe() [0x11a9eec]
/glade/scratch/jinmuluo/MESOCOM/bld/cesm.exe() [0x11a5596]
/glade/scratch/jinmuluo/MESOCOM/bld/cesm.exe() [0x11626df]
/glade/scratch/jinmuluo/MESOCOM/bld/cesm.exe() [0xfb766d]
/glade/scratch/jinmuluo/MESOCOM/bld/cesm.exe() [0xfbddc9]
/glade/scratch/jinmuluo/MESOCOM/bld/cesm.exe() [0xfaded0]
/glade/scratch/jinmuluo/MESOCOM/bld/cesm.exe() [0x561e25]
MPI_Abort: error code = -1

lnd.log

LND: PIO numiotasks= 1
LND: PIO stride= 1
LND: PIO rearranger= 2
LND: PIO root= 1


1 pes participating in computation for CLM

-----------------------------------

NODE# NAME
( 0) r6i6n33
atm component = datm
rof component = srof
glc component = sglc
atm_prognostic = F
rof_prognostic = F
glc_present = F
flds_scalar_name = cpl_scalars
flds_scalar_num = 4
flds_scalar_index_nx = 1
flds_scalar_index_ny = 2
flds_scalar_index_nextsw_cday = 3
flds_co2a= F
flds_co2b= F
flds_co2c= F
sending co2 to atm = F
receiving co2 from atm = F
(shr_drydep_read) Read in drydep_inparm namelist from: drv_flds_in
(shr_drydep_read) No dry deposition fields will be transfered
(shr_fire_emis_readnl) Read in fire_emis_readnl namelist from: drv_flds_in
(shr_megan_readnl) Read in megan_emis_readnl namelist from: drv_flds_in
(shr_carma_readnl) Read in carma_inparm namelist from: drv_flds_in
shr_carma_readnl: no carma_inparm namelist found in drv_flds_in
(shr_ndep_readnl) Read in ndep_inparm namelist from: drv_flds_in
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
The last entry in the atm log is:

(shr_stream_getCalendar) opening stream filename = /glade/scratch/jinmuluo/MESOCOM_fluxtower_BOOI4/datmdata/clmforc.BOOI4.Solr.isu_point.2014-01.nc

If I do a ncdump -k on that file I get:

netCDF-4

I don't think netCDF-4 is supported currently. Try converting your files to cdf5, using for example, nccopy -k cdf5
 

jinmuluo

Jinmu Luo
Member
The last entry in the atm log is:

(shr_stream_getCalendar) opening stream filename = /glade/scratch/jinmuluo/MESOCOM_fluxtower_BOOI4/datmdata/clmforc.BOOI4.Solr.isu_point.2014-01.nc

If I do a ncdump -k on that file I get:

netCDF-4

I don't think netCDF-4 is supported currently. Try converting your files to cdf5, using for example, nccopy -k cdf5
Thank you! After I've converted all nc files into 64-bit format, CLM returned me another error. Any clue of this kind of error? I guess it could happened in the format of the variable, but I'm not sure what cause this.

atm.log
-----------------

(shr_strdata_readstrm) opening : /glade/scratch/jinmuluo/MESOCOM_fluxtower_BOOI4/datmdata/clmforc.BOOI4.Solr.isu_point.2014-01.nc


(shr_strdata_readstrm) setting pio descriptor : /glade/scratch/jinmuluo/MESOCOM_fluxtower_BOOI4/datmdata/clmforc.BOOI4.Solr.isu_point.2014-01.nc


(shr_strdata_set_stream_iodesc) setting iodesc for : FSDS with dimlens(1), dimlens(2) = 1 1 variable as time dimension time


example of nc file
------------------------------
netcdf clmforc.BOOI4.Solr.isu_point.2022-12 {

dimensions:

time = 744 ;

lat = 1 ;

lon = 1 ;

variables:

int time(time) ;

time:units = "hours since 2022-12-01 00:00:00" ;

time:calendar = "proleptic_gregorian" ;

float lat(lat) ;

lat:_FillValue = NaNf ;

float lon(lon) ;

lon:_FillValue = NaNf ;

double FSDS(time, lat, lon) ;

FSDS:_FillValue = NaN ;

FSDS:units = "W m-2" ;

FSDS:long_name = "surface_incoming_shortwave_flux" ;

float LONGXY(lat, lon) ;

LONGXY:_FillValue = NaNf ;

LONGXY:long_name = "longitude" ;

LONGXY:units = "degrees_east" ;

LONGXY:mode = "time-invariant" ;

float LATIXY(lat, lon) ;

LATIXY:_FillValue = NaNf ;

LATIXY:long_name = "latitude" ;

LATIXY:units = "degrees_north" ;

LATIXY:mode = "time-invariant" ;

int EDGEE(lat, lon) ;

EDGEE:long_name = "eastern edge in atmospheric data" ;

EDGEE:units = "degrees_east" ;

EDGEE:mode = "time-invariant" ;

int EDGEW(lat, lon) ;

EDGEW:long_name = "western edge in atmospheric data" ;

EDGEW:units = "degrees_west" ;

EDGEW:mode = "time-invariant" ;

int EDGES(lat, lon) ;

EDGES:long_name = "southern edge in atmospheric data" ;

EDGES:units = "degrees_south" ;

EDGES:mode = "time-invariant" ;

int EDGEN(lat, lon) ;

EDGEN:long_name = "northern edge in atmospheric data" ;

EDGEN:units = "degrees_north" ;

EDGEN:mode = "time-invariant" ;



// global attributes:

:case_title = "MESONET 1-Hourly Atmospheric Forcing: Incoming Solar" ;

:Created_by = "jinmuluo" ;

:Sources = "IEM :: ISU Soil Moisture Minute/Hourly Data Request" ;

}
 

slevis

Moderator
Staff member
I don't see an error message. Is that were the atm.log ends? Seems like you will have to think of ways to troubleshoot. For example, maybe you could put write-statements in the code so that you may find the exact line of code where it crashes, which may give you insight into what is wrong with the file.
 

jinmuluo

Jinmu Luo
Member
I don't see an error message. Is that were the atm.log ends? Seems like you will have to think of ways to troubleshoot. For example, maybe you could put write-statements in the code so that you may find the exact line of code where it crashes, which may give you insight into what is wrong with the file.
Hi Sam,

That's the end of the atm.log.
You're right, my question is that I can't see any errors from logs. I guess this question must be from the structure of my nc file, but I don't know which part cause this. Where I can begin with trouble shoot like you mentioned that put write-statements in the code?

Thanks
 

slevis

Moderator
Staff member
I do not have much experience looking at datm code, so you will need to investigate yourself or ask someone else.

Alternatively, it may be easier to initially compare the structure of your file in detail against one of the equivalent files provided with the CTSM. Try to look for anything that looks different that might explain a failure.
 
Status
Not open for further replies.
Top