From gokhan@ncar.ucar.edu Mon Dec 9 10:36:08 2002 1. summary: The zonal- and time-mean Levitus/PHC2 potential temperature and salinity fields on the standard 1 degree horizontal grid at 33 levels. All land points are filled with "reasonable" values. 2. created by: Gokhan Danabasoglu 3. date and time: Dec 6, 2002 at 13:24 4. created on: Dataproc 5. dataset format: ieeer8 6. endian: ?? 7. archival copy location: filename ----> ts_zonal_mean.ieeer8 /CCSM/inputdata/ocn/pop/res_indpt/ic/ts_zonal_mean.ieeer8 /CCSM/inputdata/ocn/pop/res_indpt/ic/ts_zonal_mean.readme 8. creation summary: The Levitus/PHC2 potential temperature and salinity fields from the files in item #9 are temporally and zonally averaged. Any missing land points are filled with values from the latitudinal direction (after zonal averaging). 9. derived from: /fs/cgd/data0/gokhan/phc_data/PHC2_TEMP.nc /fs/cgd/data0/gokhan/phc_data/PHC2_SALT.nc 10. code, scripts, namelists, etc, used to create this file: The following IDL code creates this file: ***** NOTE: Gokhan's original e-mail follows this IDL code ***** -------------------------------------------------------------------- temp_file = '/fs/cgd/data0/gokhan/phc_data/PHC2_TEMP.nc' salt_file = '/fs/cgd/data0/gokhan/phc_data/PHC2_SALT.nc' missing = -89 missing2 = -99 print, ' reading TEMP .... ' fileid = ncdf_open(temp_file) varid = ncdf_varid(fileid, 'TEMP') ncdf_varget, fileid, varid, FIELD nx = (size(FIELD))(1) ny = (size(FIELD))(2) nz = (size(FIELD))(3) nt = (size(FIELD))(4) print, ' nx = ', nx print, ' ny = ', ny print, ' nz = ', nz print, ' nt = ', nt FIELD_TAVG = dblarr(nx,ny,nz) FIELD_TAVG(0:nx-1,0:ny-1,0:nz-1) = double(0.) TEMP_XTAVG = dblarr(ny,nz) TEMP_XTAVG(0:ny-1,0:nz-1) = double(0.) SALT_XTAVG = dblarr(ny,nz) SALT_XTAVG(0:ny-1,0:nz-1) = double(0.) print, ' computing TAVG TEMP .... ' for k=0,nz-1 do begin for j=0,ny-1 do begin for i=0,nx-1 do begin count = 0 for n=0,nt-1 do begin if ( FIELD(i,j,k,n) gt missing ) then begin FIELD_TAVG(i,j,k) = FIELD_TAVG(i,j,k) + FIELD(i,j,k,n) count = count + 1 endif endfor if ( count ne 0 and count ne nt ) then $ message, ' error in count for TEMP ..... ' if ( count eq 0 ) then FIELD_TAVG(i,j,k) = missing2 if ( count eq nt ) then $ FIELD_TAVG(i,j,k) = FIELD_TAVG(i,j,k) / double(nt) endfor endfor endfor print, ' computing XAVG TEMP .... ' for k=0,nz-1 do begin for j=0,ny-1 do begin count = 0 for i=0,nx-1 do begin if ( FIELD_TAVG(i,j,k) gt missing ) then begin TEMP_XTAVG(j,k) = TEMP_XTAVG(j,k) + FIELD_TAVG(i,j,k) count = count + 1 endif endfor if ( count ne 0 ) then begin TEMP_XTAVG(j,k) = TEMP_XTAVG(j,k) / double(count) endif else begin TEMP_XTAVG(j,k) = missing2 endelse endfor endfor print, ' reading SALT .... ' fileid = ncdf_open(salt_file) varid = ncdf_varid(fileid, 'SALT') ncdf_varget, fileid, varid, FIELD print, ' computing TAVG SALT .... ' FIELD_TAVG(0:nx-1,0:ny-1,0:nz-1) = double(0.) for k=0,nz-1 do begin for j=0,ny-1 do begin for i=0,nx-1 do begin count = 0 for n=0,nt-1 do begin if ( FIELD(i,j,k,n) gt missing ) then begin FIELD_TAVG(i,j,k) = FIELD_TAVG(i,j,k) + FIELD(i,j,k,n) count = count + 1 endif endfor if ( count ne 0 and count ne nt ) then $ message, ' error in count for SALT ..... ' if ( count eq 0 ) then FIELD_TAVG(i,j,k) = missing2 if ( count eq nt ) then $ FIELD_TAVG(i,j,k) = FIELD_TAVG(i,j,k) / double(nt) endfor endfor endfor print, ' computing XAVG SALT .... ' for k=0,nz-1 do begin for j=0,ny-1 do begin count = 0 for i=0,nx-1 do begin if ( FIELD_TAVG(i,j,k) gt missing ) then begin SALT_XTAVG(j,k) = SALT_XTAVG(j,k) + FIELD_TAVG(i,j,k) count = count + 1 endif endfor if ( count ne 0 ) then begin SALT_XTAVG(j,k) = SALT_XTAVG(j,k) / double(count) endif else begin SALT_XTAVG(j,k) = missing2 endelse endfor endfor for k=0,nz-1 do begin for j=0,ny-1 do begin if ( TEMP_XTAVG(j,k) lt missing and $ SALT_XTAVG(j,k) gt missing ) then $ message, ' incompatable missing values 1 .... ' if ( SALT_XTAVG(j,k) lt missing and $ TEMP_XTAVG(j,k) gt missing ) then $ message, ' incompatable missing values 2 .... ' endfor endfor TEMP_XTAVG_ORIG = TEMP_XTAVG SALT_XTAVG_ORIG = SALT_XTAVG print, ' filling in missing data .... ' for k=0,nz-1 do begin jump0: count = 0 for j=0,ny-2 do begin if ( TEMP_XTAVG(j ,k) lt missing and $ TEMP_XTAVG(j+1,k) lt missing ) then $ count = 1 if ( TEMP_XTAVG(j ,k) lt missing and $ TEMP_XTAVG(j+1,k) gt missing ) then $ TEMP_XTAVG(j,k) = TEMP_XTAVG(j+1,k) if ( SALT_XTAVG(j ,k) lt missing and $ SALT_XTAVG(j+1,k) gt missing ) then $ SALT_XTAVG(j,k) = SALT_XTAVG(j+1,k) endfor for j=ny-1,1,-1 do begin if ( TEMP_XTAVG(j ,k) lt missing and $ TEMP_XTAVG(j-1,k) gt missing ) then $ TEMP_XTAVG(j,k) = TEMP_XTAVG(j-1,k) if ( SALT_XTAVG(j ,k) lt missing and $ SALT_XTAVG(j-1,k) gt missing ) then $ SALT_XTAVG(j,k) = SALT_XTAVG(j-1,k) endfor if ( count ne 0 ) then goto, jump0 endfor print, ' reading LAT .... ' varid = ncdf_varid(fileid, 'lat') ncdf_varget, fileid, varid, LAT_SINGLE ; degrees_north LAT = double(LAT_SINGLE) print, ' reading DEPTH .... ' varid = ncdf_varid(fileid, 'depth') ncdf_varget, fileid, varid, DEPTH_SINGLE ; meters DEPTH = double(DEPTH_SINGLE) print, ' writing output .... ' openw, 1, 'TS_zonal_mean.ieeer8', /f77 writeu, 1, LAT writeu, 1, DEPTH writeu, 1, TEMP_XTAVG writeu, 1, SALT_XTAVG close, 1 end /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ Gokhan Danabasoglu phone: (303) 497-1604 Oceanography Section fax: (303) 497-1700 Climate and Global Dynamics Division e-mail: gokhan@ncar.ucar.edu National Center for Atmospheric Research P.O. Box 3000 Boulder, CO 80307 USA \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ From gokhan@ncar.ucar.edu Mon Dec 9 10:38:32 2002 To: Lawrence Buja Cc: Nancy J. Norton , Keith Lindsay , Peter Gent , William G. Large Subject: zonal-mean ic for POP Dear All, I have created a new T-S initialization option for POP. It is called "zonal-mean". I have compiled and have run the model for a few days using this new initialization. To use this option, the only file that needs to be modified is initial.F. For now, it is at /home/gokhan/initial.F on the CGD systems. This file is based on beta61. Yes, the latest and the greatest! So, beta61 initial.F needs to be overwritten by the above version. The new subroutine in initial.F, called init_ts_zonal_mean, reads a data set (see below) and bilinearly interpolates them onto the model grid. The associated data file is /fs/cgd/data0/gokhan/TS_zonal_mean.ieeer8 Note that this file is independent of the ocean model resolution as it contains the zonal- and time-mean potential temperature and salinity fields on the standard, Levitus 1 degree horizontal grid at 33 levels. Also, all land points are filled with "reasonable" values. To use these zonal-mean initial conditions, one must set in ocn.setup.csh: (modified by njn01 9 Dec 2002) 1) set INIT_TS_OPTION = 'zonal_mean' 2) change the line: s#INIT_TS_OPTION#$RUNTYPE# to s#INIT_TS_OPTION#$INIT_TS_OPTION# 3) setenv INIT_TS_FILE ts_zonal_mean LAWRENCE: You may need to copy the data file manually. Please note that this file is only for T and S. Any additional tracers need to added if so desired. Also, there have been no attempts to eliminate the statically unstable density profiles that are known to exist. I am assuming that this will be one of the standard initialization options. So, the above files need to be copied to the standard locations and the scripts should be modified as necessary. any comments/bug reports are welcome. gokhan /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ Gokhan Danabasoglu phone: (303) 497-1604 Oceanography Section fax: (303) 497-1700 Climate and Global Dynamics Division e-mail: gokhan@ncar.ucar.edu National Center for Atmospheric Research P.O. Box 3000 Boulder, CO 80307 USA \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/