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

POP initial condition (PHC2) data as netCDF?

Dear CESM/POP community,

I would like to analyze the exact initial conditions that POP uses when started from PHC2/Levitus data (`ccsm_startup` option).

I need the fields for different grid resolutions (in particular gx3v7 and gx1v6).

The problem is that they seem only to be available in some .ieeer8 binary format that I am unable read.

Are they by any chance also available as netCDF or is there a way of reading them?

Best regards,
Jonas

PS: For anyone looking into this: The files are located in `DIN_LOC_ROOT/ocn/pop//ic`, named e.g. `ts_PHC2_jan_ic_gx1v6_20090205.ieeer8` and read using the subroutine `init_ts` from `initial.F90`:

1117 in_file = construct_file(init_ts_file_fmt, &
1118 full_name=trim(init_ts_file), &
1119 record_length = rec_type_dbl, &
1120 recl_words=nx_global*ny_global)
1121 call data_set(in_file,'open_read')
1122
1123 i_dim = construct_io_dim('i',nx_global)
1124 j_dim = construct_io_dim('j',ny_global)
1125 k_dim = construct_io_dim('k',km)
1126
1127 io_temp = construct_io_field('TEMPERATURE', &
1128 dim1=i_dim, dim2=j_dim, dim3=k_dim, &
1129 field_loc = field_loc_center, &
1130 field_type = field_type_scalar, &
1131 d3d_array=TEMP_DATA)
1132 io_salt = construct_io_field('SALINITY', &
1133 dim1=i_dim, dim2=j_dim, dim3=k_dim, &
1134 field_loc = field_loc_center, &
1135 field_type = field_type_scalar, &
1136 d3d_array=TEMP_DATA)
1137
1138 call data_set(in_file,'define',io_temp)
1139 call data_set(in_file,'define',io_salt)
1140
1141 call data_set(in_file,'read' ,io_temp)
1142 do iblock=1,nblocks_clinic
1143 TRACER(:,:,:,1,curtime,iblock) = TEMP_DATA(:,:,:,iblock)
1144 end do
1145 call data_set(in_file,'read' ,io_salt)
1146 do iblock=1,nblocks_clinic
1147 TRACER(:,:,:,2,curtime,iblock) = TEMP_DATA(:,:,:,iblock)
1148 end do
 

njn01

Member
These initial conditions exist only in binary format. One (cumbersome) way to get T and S  in a netcdf-format file is this:  set up a CESM case (a C compset would suffice),  change the standard pop2 output settings so that you get time-averaged ocean history fields and files every timestep (hence instantaneous fields, not an average at all), and run the case for two days (in a startup case, the ocean starts up on the second day).   This will give you TEMP and SALT after one model timestep, so technically these are not the initial conditions.  Another approach would be to set this same case up to output model RESTART files every timestep; the initial T,S will appear in the first restart file as time-level "_OLD". Note that POP2 netCDF restart files do not contain grid information; history files do.
 
That worked great, thanks! And was not that cumbersome at all:

./xmlchange -file env_run.xml -id STOP_OPTION -val ndays
./xmlchange -file env_run.xml -id STOP_N -val 2
./xmlchange -file env_run.xml -id REST_OPTION -val nsteps
./xmlchange -file env_run.xml -id REST_N -val 1

(for the second approach)

Cheers,
Jonas
 
Top