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

About findat format problem

MikeYuan

tfYuan
Member
Hello,
I used the IHistClm50BgcCrop, now, I want to add one of my own variable to the finidat ('/......inputdata/lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190312.nc'), however, my variable is two-dimension based on the lat and lon, how should I do to convert my data to one-dimension such as grid or column that meet the format of finidat. Is there any tool could fix the problem in CLM5?
Looking forward the reply~
Thank you very much!
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
I don't know of any tools that are available to do that. But there is information on the initial/restart file that could help. For example, if the variable you are reading in is indeed a gridcell-level variable then you could use the grid1d_lon and grid1d_lat variables on the initial file to map your 2d variable to 1d.
For example, TWS (total water storage) has a dimension of (gridcell). TWS(1) has a latitude of grid1d_lat(1) = -90. and a longitude of grid1d_lon(1) = 0.
There are similar variables for landunit (land1d_lat, land1d_lon), column (col1d_lat, col1d_lon), and pft (pft1d_lat, pft1d_lon) variables. For those subgrid variables, there are other variables to help distinguish between surfaces types, e.g., land1d_ityplun, cols1d_ityplun, cols1d_ityp, pfts1d_itypveg, pfts1d_itypcol, pfts1d_ityplun.
 

MikeYuan

tfYuan
Member
I don't know of any tools that are available to do that. But there is information on the initial/restart file that could help. For example, if the variable you are reading in is indeed a gridcell-level variable then you could use the grid1d_lon and grid1d_lat variables on the initial file to map your 2d variable to 1d.
For example, TWS (total water storage) has a dimension of (gridcell). TWS(1) has a latitude of grid1d_lat(1) = -90. and a longitude of grid1d_lon(1) = 0.
There are similar variables for landunit (land1d_lat, land1d_lon), column (col1d_lat, col1d_lon), and pft (pft1d_lat, pft1d_lon) variables. For those subgrid variables, there are other variables to help distinguish between surfaces types, e.g., land1d_ityplun, cols1d_ityplun, cols1d_ityp, pfts1d_itypveg, pfts1d_itypcol, pfts1d_ityplun.
Thanks for your reply ,Mr. Oleson.
So far, I followed your suggestion to mapped my new variable(grid) through TWS, and added it to the initial file(finidat), then put the file in user_nl_clm such as finidat="/data/........./my_clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190312.nc".
However, I have no idea where to recognize and read the variable in the source code, is there any specific file to read the variable from the initial/restart file (finidat)?
Looking forward the reply~
Thank you very much!
Mike.
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
Using TWS as an example, if you grep in the source code for TWS, you will see this in src/biogeophys/WaterStateType.F90:

call restartvar(ncid=ncid, flag=flag, varname='TWS', xtype=ncd_double, &
dim1name=nameg, &
long_name='Total Water Storage', units='mm', &
interpinic_flag='interp', readvar=readvar, data=this%tws_grc)

These lines are in subroutine Restart. Here, TWS from the restart file is being read in to variable tws_grc in the code. So you would need to add lines to read your variable in appropriately. You can grep for tws_grc in the code to find out how the variable is defined, allocated memory, and initialized.
This particular variable is a water state variable and hence is addressed in WaterStateType.F90. Your variable should go in the most appropriate module.
 

MikeYuan

tfYuan
Member
Using TWS as an example, if you grep in the source code for TWS, you will see this in src/biogeophys/WaterStateType.F90:

call restartvar(ncid=ncid, flag=flag, varname='TWS', xtype=ncd_double, &
dim1name=nameg, &
long_name='Total Water Storage', units='mm', &
interpinic_flag='interp', readvar=readvar, data=this%tws_grc)

These lines are in subroutine Restart. Here, TWS from the restart file is being read in to variable tws_grc in the code. So you would need to add lines to read your variable in appropriately. You can grep for tws_grc in the code to find out how the variable is defined, allocated memory, and initialized.
This particular variable is a water state variable and hence is addressed in WaterStateType.F90. Your variable should go in the most appropriate module.
Thanks for your reply ,Mr. Oleson.
I have added these lines as TWS in the subroutin Restart in my module previously defined.But the result of my variable--soilHg had no value and it showed the fill value in every grid when I runed my compset for two months. I am coufused about it, would you know how to fix it?
Looking forward the reply~
Thank you very much!
Mike.
 

Attachments

  • SoilBiogeochemHgStateType.txt
    47 KB · Views: 1
  • user_nl_clm.txt
    3.1 KB · Views: 3

oleson

Keith Oleson
CSEG and Liaisons
Staff member
There isn't enough information for me to solve your problem. One recommendation I have is to setup a single point simulation that you can debug more easily, instead of a global simulation.
 
Top