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 write a nc file to in forcing_pt_interior_nml in pop2 namelist

Dear professors:
Recently i write a nc file and my namelist is as follows
forcing_pt_interior_nml
pt_interior_data_type = 'monthly-calendar'
pt_interior_data_inc = 24.
pt_interior_interp_freq = 'every-timestep'
pt_interior_interp_type = 'linear'
pt_interior_interp_inc = 72.
pt_interior_restore_tau = 365.
pt_interior_filename = '/home/jys/work/cesm/archive/PB30/ocn/climate_nc_dou/temp_1501.nc'
pt_interior_file_fmt = 'nc'
pt_interior_restore_max_level = 60
pt_interior_formulation = 'restoring'
pt_interior_data_renorm(1) = 1.
pt_interior_variable_restore = .true.
pt_interior_restore_filename = '/home/jys/work/cesm/archive/PB30/ocn/climate_nc_dou/pt_restore.nc'
pt_interior_restore_file_fmt = 'nc'
/
but unfortunately,in ccsm.log*
POP aborting...
Error in getting varid for netCDF field

------------------------------------------------------------------------
application called MPI_Abort(MPI_COMM_WORLD, 0) - process 1
------------------------------------------------------------------------

POP aborting...
Error in getting varid for netCDF field
If i change the nc file(12*60*116*100) to a binary file ,the model can work well,but i am not sure the binary is right when the model reads it.So would anyone can help me find out why the nc file can not be read in the model.It is because i do not have netcdf.inc or anything else?I do not know...
Many thanks for your helping!
 

mlevy

Michael Levy
CSEG and Liaisons
Staff member
There are two things you should do:
1) Instead of having one netcdf field that is 12x60x116*100, you should have 12 fields that are 60x116x100 (and they should be named TEMPERATURE01, TEMPERATURE02, ..., TEMPERATURE12); this is required because of the way monthly forcing data is read by the model.2) Copy $CCSMROOT/models/ocn/pop2/source/forcing_pt_interior.F90 to $CASEROOT/SourceMods/src.pop2 and make the following change to line 359          write(pt_interior_data_names(n),'(a11,i2.2)') 'TEMPERATURE',n(You just need to add the ".2" after the i2). Currently the code looks for variables named "TEMPERATURE 1", "TEMPERATURE 2", ... "TEMPERATURE12" and this source modification adds the leading 0 to single digit months.
 
thanks so much,you really help me a lot!I have another question,if i use binary file instead of nc file,should i do the things as follows:1) write(98,rec=1) (((pt_out(ii,jj,ikk,1),ii=1,imt),jj=1,jmt),ikk=1,kmt) ... write(98,rec=12) (((pt_out(ii,jj,ikk,12),jj=1,imt),jj=1,jmt),ikk=1,kmt) ,the file is direct accent and double precision  2) do not to do the second thing you mentioned.Should i offer a header file?i met the problem before,in ocn.log.*WARNING: Input header file does not existfor file: /home/jys/work/cesm/archive/PB30/ocn/climate_1/temp_clim_pre.dat.hdr
Assuming fields will be read in sequential orderInterior PT Monthly file read: /home/jys/work/cesm/archive/PB30/ocn/climate_1/temp_clim_pre.dat   I do not know how to write header file ......Should i just use sequential order?Would you please do me another favor?It bothers me a lot .
 
Dear sir, I have difficulty in writting a nc file about  pt_interior_filename for the case "monthly" in pop2 namelist. Could you send me an example data for the gx1v6 grid? Thanks a lot!
 
Top