Changeset 4091 for branches/2013
- Timestamp:
- 2013-10-21T18:09:48+02:00 (11 years ago)
- Location:
- branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/CONFIG/makenemo
r3937 r4091 82 82 x_h=""; 83 83 x_n=""; 84 x_o=false; 84 85 x_r=""; 85 86 x_m=""; … … 114 115 #- 115 116 #- Choice of the options --- 116 while getopts :hd:n:r:m:j:e:s:v:t:k: V117 while getopts :hd:n:r:m:j:e:s:v:t:k:o V 117 118 do 118 119 case $V in … … 132 133 echo " -k 0/1 : used cpp keys check (default = 1 -> check activated)"; 133 134 echo " -t dir : temporary directory for compilation" 135 echo " -o : build offline obs_oper executable in addition to NEMO"; 134 136 echo ""; 135 137 echo "Example to install a new configuration MY_CONFIG"; … … 162 164 (r) x_r=${OPTARG};; 163 165 (m) x_m=${OPTARG};; 166 (o) x_o=true;; 164 167 (j) x_j=${OPTARG};; 165 168 (t) x_t=${OPTARG};; … … 223 226 export NEMO_TDIR=${NEMO_TDIR:-$CONFIG_DIR} 224 227 export NEMO_DIR=${MAIN_DIR}/${x_s} 228 OFFLINE_OBSOPER=${x_o} 225 229 226 230 #- Check if the tool or the compiler exist or list it … … 263 267 fi 264 268 269 #- Offline obs_oper settings 270 if [ ${OFFLINE_OBSOPER} ] ; then 271 # Append extra directory to NEMO sub-directory list 272 match=0 273 for DIR in "${TAB[@]}"; do 274 if [[ $DIR == "OOO_SRC" ]] ; then 275 match=1 276 break 277 fi 278 done 279 if [[ $match == 0 ]]; then 280 TAB+=('OOO_SRC') 281 fi 282 283 # Add extra keys to list_add_key 284 if ! echo ${list_add_key} | grep -q "key_offobsoper" ; then 285 echo "Adding key_offobsoper" 286 list_add_key="${list_add_key} key_offobsoper" 287 fi 288 289 if ! echo ${list_add_key} | grep -q "key_diaobs" ; then 290 echo "Adding key_diaobs" 291 list_add_key="${list_add_key} key_diaobs" 292 fi 293 fi 294 265 295 #- 266 296 #- Save new configuration and directories names --- … … 327 357 . ${COMPIL_DIR}/Fprep_agrif.sh ${NEW_CONF} ${NEMO_TDIR} || exit 328 358 359 360 #- Offline obs_oper configuration 361 if [ ${OFFLINE_OBSOPER} ] ; then 362 if ! grep -q "offline_oper.exe" ${COMPIL_DIR}/${USEBLD} ; then 363 sed '/bld::target.*nemo.exe/ s/$/ offline_oper.exe/' ${COMPIL_DIR}/${USEBLD} > ${COMPIL_DIR}/cfg.tmp 364 mv ${COMPIL_DIR}/cfg.tmp ${COMPIL_DIR}/${USEBLD} 365 fi 366 fi 367 329 368 #- 330 369 #_ END OF CONFIGURATION PHASE -
branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/off_netcdf.F90
r4031 r4091 10 10 11 11 CONTAINS 12 13 SUBROUTINE off_wri_netcdf(cmodel, cname, cversion, cdate, &14 & nobs, nvars, ndeps, nfcst,knproc, &15 & cdtyp, cdwmo, p_unit, p_vnam, &16 & p_lam, p_phi, p_dep, p_tim, &17 & p_ob, p_mc, p_qc, p_xt, ifcst, &18 & field, mjuld)19 !!---------------------------------------------20 !! Routine to create class 4 format netcdf file21 !!---------------------------------------------22 USE netcdf23 IMPLICIT NONE24 25 !! Routine arguments26 CHARACTER(len=*), INTENT(IN) :: cmodel !: e.g. orca02527 CHARACTER(len=8), INTENT(IN) :: cdate !: YYYYMMDD28 CHARACTER(len=*), INTENT(IN) :: cversion !: 12.029 CHARACTER(len=7), INTENT(IN) :: cname !: profile30 CHARACTER(len=3), INTENT(IN) :: field !: field type e.g. fct, per, cli etc.31 INTEGER, INTENT(IN) :: nobs !: number of profiles32 INTEGER, INTENT(IN) :: nvars !: number of variables33 INTEGER, INTENT(IN) :: ndeps !: number of depths34 INTEGER, INTENT(IN) :: nfcst !: number of forecast days35 INTEGER, INTENT(IN) :: ifcst !: current forecast day36 INTEGER,PARAMETER :: nstr=8 !: string_length37 INTEGER, INTENT(IN) :: knproc !: processor number38 CHARACTER(LEN=*), DIMENSION(nobs), INTENT(IN) :: &39 & cdtyp !: Instrument type40 CHARACTER(LEN=8), DIMENSION(nobs), INTENT(IN) :: &41 & cdwmo ! WMO number42 CHARACTER(LEN=128), DIMENSION(nobs) :: &43 & cdpad !: Instrument type (padded)44 CHARACTER(LEN=8), DIMENSION(nvars), INTENT(IN) :: &45 & p_unit, & !: variable units (e.g. psu)46 & p_vnam !: variable names (e.g. vosaline)47 REAL(KIND=sp), DIMENSION(nobs), INTENT(IN) :: &48 & p_phi, & !: Latitude49 & p_lam !: Longitude50 REAL(KIND=sp), DIMENSION(ndeps,nobs), INTENT(IN) :: &51 & p_dep !: Depth52 REAL(KIND=sp), DIMENSION(ndeps,nvars,nobs), INTENT(IN) :: &53 & p_xt, & !: optional extra component54 & p_mc, & !: T model couterpart55 & p_ob !: T observation56 REAL(KIND=dp), DIMENSION(nobs), INTENT(IN) :: &57 & p_tim !: Time58 INTEGER, DIMENSION(ndeps,nvars,nobs), INTENT(IN) :: &59 & p_qc !: Observation QC60 61 REAL, INTENT(IN) :: mjuld !: Model Julian Day62 63 !! Local Variables64 CHARACTER(LEN=12), PARAMETER :: cpname='cl4_wri_ncdf'65 CHARACTER(len=80) :: cfname, &66 & cf_stem,&67 & cf_end68 CHARACTER(len=23) :: ref_date !: reference date holder69 CHARACTER(len=6) :: noon !: reference time70 INTEGER :: ifc71 INTEGER :: ncid72 INTEGER :: fdvid, & !: forecast day varid73 & lonid, & !: longitude varid74 & latid, & !: latitude varid75 & depid, & !: depth varid76 & varid, & !: var name varid77 & unitid,& !: unit name varid78 & obvid, & !: observation varid79 & fcvid, & !: forecast varid80 & prvid, & !: persistence varid81 & clvid, & !: climatology varid82 & dm2id, & !: daym2 varid83 & dm1id, & !: daym1 varid84 & mdtid, & !: MDT varid85 & altid, & !: Altimeter bias varid86 & qcvid, & !: QC varid87 & jdvid, & !: Julian day varid88 & mjdid, & !: Model Julian day varid89 & typid, & !: Observation type varid90 & idvid, & !: Observation id varid91 & istat !: Netcdf status indicator92 INTEGER :: iob, idep, ivar93 INTEGER :: dpdim, fcdim, vrdim, obdim, stdim, sxdim94 INTEGER, DIMENSION(2) :: dim2a, dim2b, dim2c, dim2d95 INTEGER, DIMENSION(3) :: dim3a96 INTEGER, DIMENSION(4) :: dim4a97 INTEGER, DIMENSION(nfcst) :: fcday98 REAL, DIMENSION(nfcst) :: mjd99 LOGICAL :: ln_new !: New file flag100 ! Global att variables101 CHARACTER(len=40) :: date_str, &102 & cont_str, &103 & obty_str, &104 & conf_str105 106 ! QC att variable107 CHARACTER(len=40) :: qcval_str108 CHARACTER(len=128) :: qcdes_str109 INTEGER, DIMENSION(2) :: flags110 111 !!============================================================================================112 !! Test input data values113 IF ( MAXVAL(p_mc(:,:,:)) .GT. obfillflt ) WRITE(*,*) 'Warning : Fcst T input data exceeds, ',obfillflt114 IF ( MAXVAL(p_ob(:,:,:)) .GT. obfillflt ) WRITE(*,*) 'Warning : Obs T input data exceeds, ',obfillflt115 !!============================================================================================116 117 ! Create output filename118 cf_stem = 'class4_'//trim(cdate)//'_FOAM_'//trim(cmodel)//'_'//trim(cversion)//'_'//trim(cname)//'_'119 WRITE(cf_end, FMT="(I4.4,'.nc')") knproc120 cfname = trim(cf_stem)//trim(cf_end)121 122 ! QC attribute string settings123 IF (cname .EQ. 'profile') THEN124 qcval_str = '0 - good data. 9 - bad data.'125 qcdes_str = ''126 flags = (/0, 9/)127 ELSE IF (cname .EQ. 'SST') THEN128 qcval_str = '0 - good data. 1 - bad data.'129 qcdes_str = 'In situ qc flag set to 0 if prob. of gross error < 0.5, 1 otherwise. AATSR qc flag set to 0 for best_quality, 1 otherwise.'130 flags = (/0, 1/)131 ELSE IF (cname .EQ. 'SLA') THEN132 qcval_str = '0 - good data. 9 - bad data.'133 qcdes_str = ''134 flags = (/0, 9/)135 ELSE136 qcval_str = ''137 qcdes_str = ''138 flags = (/0, 9/)139 END IF140 141 ! Check file exists142 istat = nf90_open(trim(cfname), nf90_nowrite, ncid)143 IF (istat == nf90_noerr) THEN144 ln_new = .FALSE.145 istat = nf90_close(ncid)146 ELSE147 ln_new = .TRUE.148 END IF149 150 ! Create file151 IF (ln_new) THEN152 CALL chkerr( nf90_create(trim(cfname),nf90_clobber,ncid), cpname, __LINE__ )153 154 !! Global Dimension section155 ! Partially hardwired for now156 CALL date_format(date_str)157 cont_str = 'andrew.ryan@metoffice.gov.uk'158 obty_str = trim(cname)159 conf_str = trim(cmodel)160 noon = '120000' ! hhmmss161 CALL yyyymmdd_to_ref_date(cdate, noon, ref_date)162 163 CALL chkerr( nf90_put_att(ncid, nf90_global, 'title', &164 & 'Forecast class 4 file'), cpname, __LINE__ )165 CALL chkerr( nf90_put_att(ncid, nf90_global, 'version', &166 & trim(cversion)), cpname, __LINE__ )167 CALL chkerr( nf90_put_att(ncid, nf90_global, 'creation_date', &168 & trim(date_str) ), cpname, __LINE__ )169 CALL chkerr( nf90_put_att(ncid, nf90_global, 'validity_time', &170 & trim(ref_date) ), cpname, __LINE__ )171 CALL chkerr( nf90_put_att(ncid, nf90_global, 'contact', &172 & trim(cont_str) ), cpname, __LINE__ )173 CALL chkerr( nf90_put_att(ncid, nf90_global, 'obs_type', &174 & trim(obty_str) ), cpname, __LINE__ )175 CALL chkerr( nf90_put_att(ncid, nf90_global, 'system', &176 & 'FOAM'), cpname, __LINE__ )177 CALL chkerr( nf90_put_att(ncid, nf90_global, 'configuration', &178 & trim(conf_str) ), cpname, __LINE__ )179 CALL chkerr( nf90_put_att(ncid, nf90_global, 'institution', &180 & 'UK Met Office' ), cpname, __LINE__ )181 182 !! Define Dimensions183 CALL chkerr( nf90_def_dim(ncid, 'numdeps', ndeps, dpdim) ,cpname, __LINE__ )184 CALL chkerr( nf90_def_dim(ncid, 'numfcsts', nfcst, fcdim) ,cpname, __LINE__ )185 CALL chkerr( nf90_def_dim(ncid, 'numvars', nvars, vrdim) ,cpname, __LINE__ )186 CALL chkerr( nf90_def_dim(ncid, 'numobs', nobs, obdim) ,cpname, __LINE__ )187 CALL chkerr( nf90_def_dim(ncid, 'string_length8', nstr, stdim) ,cpname, __LINE__ )188 CALL chkerr( nf90_def_dim(ncid, 'string_length128',128, sxdim) ,cpname, __LINE__ )189 190 !! Define possible dimension permutations191 ! 2d192 dim2a(:) = (/ dpdim, obdim /) !: (/ ndeps, nobs /)193 dim2b(:) = (/ stdim, obdim /) !: (/ nstr, nobs /)194 dim2c(:) = (/ stdim, vrdim /) !: (/ nstr, nvars /)195 dim2d(:) = (/ sxdim, obdim /) !: (/ 128, nobs /)196 ! 3d197 dim3a(:) = (/ dpdim, vrdim, obdim/) !: (/ ndeps, nvars, nobs /)198 ! 4d199 dim4a(:) = (/ dpdim, fcdim, vrdim, obdim /) !: (/ ndeps, nfcst, nvars, nobs /)200 201 202 !! Create the variables203 ! Forecast day204 CALL chkerr( nf90_def_var(ncid, 'leadtime', nf90_float, fcdim, fdvid) ,cpname, __LINE__ )205 CALL chkerr( nf90_put_att(ncid, fdvid, 'long_name', 'Model forecast day offset') ,cpname, __LINE__ )206 CALL chkerr( nf90_put_att(ncid, fdvid, 'units', 'Hours') ,cpname, __LINE__ )207 CALL chkerr( nf90_put_att(ncid, fdvid, 'comment','Hours between forecast production and validity time') ,cpname, __LINE__ )208 ! longitude209 CALL chkerr( nf90_def_var(ncid, 'longitude', nf90_float, obdim, lonid) ,cpname, __LINE__ )210 CALL chkerr( nf90_put_att(ncid, lonid, 'long_name', 'Longitudes') ,cpname, __LINE__ )211 CALL chkerr( nf90_put_att(ncid, lonid, 'units', 'Degrees') ,cpname, __LINE__ )212 ! latitude213 CALL chkerr( nf90_def_var(ncid, 'latitude', nf90_float, obdim, latid) ,cpname, __LINE__ )214 CALL chkerr( nf90_put_att(ncid, latid, 'long_name', 'Latitudes') ,cpname, __LINE__ )215 CALL chkerr( nf90_put_att(ncid, latid, 'units', 'Degrees') ,cpname, __LINE__ )216 ! depth217 CALL chkerr( nf90_def_var(ncid, 'depth', nf90_float, dim2a, depid) ,cpname, __LINE__ )218 CALL chkerr( nf90_put_att(ncid, depid, 'long_name', 'Depths') ,cpname, __LINE__ )219 CALL chkerr( nf90_put_att(ncid, depid, 'units', 'metre') ,cpname, __LINE__ )220 CALL chkerr( nf90_put_att(ncid, depid, '_FillValue',obfillflt) ,cpname, __LINE__ )221 ! varname222 CALL chkerr( nf90_def_var(ncid, 'varname', nf90_char, dim2c, varid) ,cpname, __LINE__ )223 CALL chkerr( nf90_put_att(ncid, varid, 'long_name', 'Variable name') ,cpname, __LINE__ )224 ! unitname225 CALL chkerr( nf90_def_var(ncid, 'unitname', nf90_char, dim2c, unitid) ,cpname, __LINE__ )226 CALL chkerr( nf90_put_att(ncid, unitid, 'long_name', 'Unit name') ,cpname, __LINE__ )227 ! obs228 CALL chkerr( nf90_def_var(ncid, 'observation', nf90_float, dim3a, obvid) ,cpname, __LINE__ )229 CALL chkerr( nf90_put_att(ncid, obvid, '_FillValue',obfillflt) ,cpname, __LINE__ )230 CALL chkerr( nf90_put_att(ncid, obvid, 'long_name', 'Observation value') ,cpname, __LINE__ )231 ! forecast232 CALL chkerr( nf90_def_var(ncid, 'forecast', nf90_float, dim4a, fcvid) ,cpname, __LINE__ )233 CALL chkerr( nf90_put_att(ncid, fcvid, '_FillValue',obfillflt) ,cpname, __LINE__ )234 CALL chkerr( nf90_put_att(ncid, fcvid, 'long_name', 'Model forecast counterpart of obs. value') ,cpname, __LINE__ )235 CALL chkerr( nf90_put_att(ncid, fcvid, 'comment', 'Model daily mean valid at noon used for calculation') ,cpname, __LINE__ )236 ! persistence237 CALL chkerr( nf90_def_var(ncid, 'persistence', nf90_float, dim4a, prvid) ,cpname, __LINE__ )238 CALL chkerr( nf90_put_att(ncid, prvid, '_FillValue',obfillflt) ,cpname, __LINE__ )239 CALL chkerr( nf90_put_att(ncid, prvid, 'long_name', 'Model persistence counterpart of obs. value'),cpname, __LINE__ )240 CALL chkerr( nf90_put_att(ncid, prvid, 'comment', 'Model daily mean valid at noon used for calculation') ,cpname, __LINE__ )241 ! clim242 CALL chkerr( nf90_def_var(ncid, 'climatology', nf90_float, dim3a, clvid) ,cpname, __LINE__ )243 CALL chkerr( nf90_put_att(ncid, clvid, '_FillValue',obfillflt) ,cpname, __LINE__ )244 CALL chkerr( nf90_put_att(ncid, clvid, 'long_name', 'Climatological value') ,cpname, __LINE__ )245 CALL chkerr( nf90_put_att(ncid, clvid, 'comment', 'Levitus monthly fields interpolated to the correct day'),cpname, __LINE__ )246 ! daym2247 CALL chkerr( nf90_def_var(ncid, 'best_estimate', nf90_float, dim3a, dm2id) ,cpname, __LINE__ )248 CALL chkerr( nf90_put_att(ncid, dm2id, '_FillValue',obfillflt) ,cpname, __LINE__ )249 CALL chkerr( nf90_put_att(ncid, dm2id, 'long_name', 'Best estimate') ,cpname, __LINE__ )250 CALL chkerr( nf90_put_att(ncid, dm2id, 'comment', 'FOAM daym2 field') ,cpname, __LINE__ )251 ! daym1252 CALL chkerr( nf90_def_var(ncid, 'nrt_analysis', nf90_float, dim3a, dm1id) ,cpname, __LINE__ )253 CALL chkerr( nf90_put_att(ncid, dm1id, '_FillValue',obfillflt) ,cpname, __LINE__ )254 CALL chkerr( nf90_put_att(ncid, dm1id, 'long_name', 'Near real time analysis') ,cpname, __LINE__ )255 CALL chkerr( nf90_put_att(ncid, dm1id, 'comment', 'FOAM daym1 field') ,cpname, __LINE__ )256 257 ! optional fields258 IF (cname .EQ. 'SLA') THEN259 ! mdt260 CALL chkerr( nf90_def_var(ncid, 'mdt_reference', nf90_float, dim3a, mdtid) ,cpname, __LINE__ )261 CALL chkerr( nf90_put_att(ncid, mdtid, '_FillValue',obfillflt) ,cpname, __LINE__ )262 CALL chkerr( nf90_put_att(ncid, mdtid, 'long_name', 'Mean dynamic topography') ,cpname, __LINE__ )263 CALL chkerr( nf90_put_att(ncid, mdtid, 'comment', 'MDT reference field') ,cpname, __LINE__ )264 ! altbias265 CALL chkerr( nf90_def_var(ncid, 'altimeter_bias', nf90_float, dim3a, altid) ,cpname, __LINE__ )266 CALL chkerr( nf90_put_att(ncid, altid, '_FillValue',obfillflt) ,cpname, __LINE__ )267 CALL chkerr( nf90_put_att(ncid, altid, 'long_name', 'Altimeter bias') ,cpname, __LINE__ )268 ENDIF269 270 ! qc271 CALL chkerr( nf90_def_var(ncid, 'qc', nf90_short, dim3a, qcvid) ,cpname, __LINE__ )272 CALL chkerr( nf90_put_att(ncid, qcvid, '_FillValue', NF90_FILL_SHORT) ,cpname, __LINE__ )273 CALL chkerr( nf90_put_att(ncid, qcvid, 'long_name', 'Quality flags') ,cpname, __LINE__ )274 CALL chkerr( nf90_put_att(ncid, qcvid, 'flag_value', flags) ,cpname, __LINE__ )275 CALL chkerr( nf90_put_att(ncid, qcvid, 'flag_meaning', qcval_str) ,cpname, __LINE__ )276 CALL chkerr( nf90_put_att(ncid, qcvid, 'comment', qcdes_str) ,cpname, __LINE__ )277 ! juld278 CALL chkerr( nf90_def_var(ncid, 'juld', nf90_double, obdim, jdvid) ,cpname, __LINE__ )279 CALL chkerr( nf90_put_att(ncid, jdvid, '_FillValue',99999.) ,cpname, __LINE__ )280 CALL chkerr( nf90_put_att(ncid, jdvid, 'long_name', 'Observation time in Julian days'),cpname, __LINE__ )281 CALL yyyymmdd_to_ref_date('19500101', '000000', ref_date)282 CALL chkerr( nf90_put_att(ncid, jdvid, 'units', 'Days since '//ref_date) ,cpname, __LINE__ )283 ! modeljuld284 CALL chkerr( nf90_def_var(ncid, 'modeljuld', nf90_float, fcdim, mjdid) ,cpname, __LINE__ )285 CALL chkerr( nf90_put_att(ncid, mjdid, 'long_name', 'Model field date in Julian days'),cpname, __LINE__ )286 CALL chkerr( nf90_put_att(ncid, mjdid, 'units', 'Days since '//ref_date) ,cpname, __LINE__ )287 ! type288 CALL chkerr( nf90_def_var(ncid, 'type', nf90_char, dim2d, typid) ,cpname, __LINE__ )289 CALL chkerr( nf90_put_att(ncid, typid, 'long_name', 'Observation type') ,cpname, __LINE__ )290 ! id291 CALL chkerr( nf90_def_var(ncid, 'id', nf90_char, dim2b, idvid) ,cpname, __LINE__ )292 CALL chkerr( nf90_put_att(ncid, idvid, 'long_name', 'Observation id') ,cpname, __LINE__ )293 ! Close netcdf file294 CALL chkerr( nf90_close(ncid), cpname, __LINE__ )295 ENDIF296 297 !! Fill the variables298 CALL chkerr( nf90_open(trim(cfname),nf90_write,ncid), cpname, __LINE__ )299 ! CALL chkerr( nf90_put_var(ncid, varid, values, start, count) ,cpname, __LINE__ )300 ! Forecast day301 DO ifc = 1,nfcst302 fcday(ifc) = (ifc - 1)*24303 ENDDO304 CALL chkerr( nf90_inq_varid(ncid,'leadtime', fdvid) ,cpname, __LINE__ )305 CALL chkerr( nf90_put_var( ncid, fdvid, fcday) ,cpname, __LINE__ )306 ! longitude307 CALL chkerr(nf90_inq_varid(ncid,'longitude', lonid) ,cpname, __LINE__ )308 CALL chkerr( nf90_put_var( ncid, lonid, p_lam) ,cpname, __LINE__ )309 ! latitude310 CALL chkerr(nf90_inq_varid(ncid,'latitude', latid) ,cpname, __LINE__ )311 CALL chkerr( nf90_put_var( ncid, latid, p_phi) ,cpname, __LINE__ )312 ! depth313 CALL chkerr(nf90_inq_varid(ncid,'depth', depid) ,cpname, __LINE__ )314 CALL chkerr( nf90_put_var( ncid, depid, p_dep) ,cpname, __LINE__ )315 ! varname316 CALL chkerr(nf90_inq_varid(ncid,'varname', varid) ,cpname, __LINE__ )317 CALL chkerr( nf90_put_var( ncid, varid, p_vnam, (/1,1/) , (/nstr,nvars/) ) ,cpname, __LINE__ )318 ! unitname319 CALL chkerr(nf90_inq_varid(ncid,'unitname', unitid) ,cpname, __LINE__ )320 CALL chkerr( nf90_put_var( ncid, unitid,p_unit, (/1,1/) , (/nstr,nvars/) ) ,cpname, __LINE__ )321 ! obs322 CALL chkerr(nf90_inq_varid(ncid,'observation', obvid) ,cpname, __LINE__ )323 CALL chkerr( nf90_put_var( ncid, obvid,p_ob ,(/1,1,1/),(/ndeps,nvars,nobs/) ),cpname, __LINE__ )324 IF (field == 'cli') THEN325 ! clim326 CALL chkerr(nf90_inq_varid(ncid,'climatology', clvid) ,cpname, __LINE__ )327 CALL chkerr( nf90_put_var(ncid, clvid,p_mc ,(/1,1,1/) ,(/ndeps,nvars,nobs/) ) ,cpname, __LINE__ )328 ELSE IF (field == 'dm2') THEN329 ! best estimate330 CALL chkerr(nf90_inq_varid(ncid,'best_estimate', dm2id) ,cpname, __LINE__ )331 CALL chkerr( nf90_put_var(ncid, dm2id,p_mc ,(/1,1,1/) ,(/ndeps,nvars,nobs/) ) ,cpname, __LINE__ )332 ELSE IF (field == 'dm1') THEN333 ! nrt_analysis334 CALL chkerr(nf90_inq_varid(ncid,'nrt_analysis', dm1id) ,cpname, __LINE__ )335 CALL chkerr( nf90_put_var(ncid, dm1id,p_mc ,(/1,1,1/) ,(/ndeps,nvars,nobs/) ) ,cpname, __LINE__ )336 ELSE IF (field == 'per') THEN337 ! persistence338 CALL chkerr(nf90_inq_varid(ncid,'persistence', prvid) ,cpname, __LINE__ )339 CALL chkerr( nf90_put_var(ncid, prvid,p_mc ,(/1,ifcst,1,1/) ,(/ndeps,1,nvars,nobs/) ) ,cpname, __LINE__ )340 ELSE IF (field == 'fct') THEN341 ! forecast342 CALL chkerr(nf90_inq_varid(ncid,'forecast', fcvid) ,cpname, __LINE__ )343 CALL chkerr( nf90_put_var(ncid, fcvid,p_mc ,(/1,ifcst,1,1/) ,(/ndeps,1,nvars,nobs/) ) ,cpname, __LINE__ )344 IF (cname == 'SLA') THEN345 ! MDT346 CALL chkerr(nf90_inq_varid(ncid,'mdt_reference', mdtid) ,cpname, __LINE__ )347 CALL chkerr( nf90_put_var(ncid, mdtid, p_xt ,(/1,1,1/) ,(/ndeps,nvars,nobs/) ) ,cpname, __LINE__ )348 END IF349 ELSE IF (field == 'alt') THEN350 ! Altimeter bias351 CALL chkerr(nf90_inq_varid(ncid,'altimeter_bias', altid) ,cpname, __LINE__ )352 CALL chkerr( nf90_put_var(ncid, altid, p_mc ,(/1,1,1/) ,(/ndeps,nvars,nobs/) ) ,cpname, __LINE__ )353 ! MDT354 CALL chkerr(nf90_inq_varid(ncid,'mdt_reference', mdtid) ,cpname, __LINE__ )355 CALL chkerr( nf90_put_var(ncid, mdtid, p_xt ,(/1,1,1/) ,(/ndeps,nvars,nobs/) ) ,cpname, __LINE__ )356 END IF357 ! qc358 CALL chkerr(nf90_inq_varid(ncid,'qc', qcvid) ,cpname, __LINE__ )359 CALL chkerr( nf90_put_var(ncid, qcvid, p_qc ,(/1,1,1/) ,(/ndeps,nvars,nobs/) ) ,cpname, __LINE__ )360 ! juld361 CALL chkerr(nf90_inq_varid(ncid,'juld', jdvid) ,cpname, __LINE__ )362 CALL chkerr( nf90_put_var( ncid, jdvid, p_tim) ,cpname, __LINE__ )363 ! modeljuld364 IF ( field == 'fct') THEN365 ! If not climatology and not persistence update model julian day366 mjd(:) = mjuld367 CALL chkerr(nf90_inq_varid(ncid,'modeljuld', mjdid) ,cpname, __LINE__ )368 CALL chkerr( nf90_put_var( ncid, mjdid, mjd,(/ifcst/),(/1/)) ,cpname, __LINE__ )369 END IF370 ! type371 CALL inst_converter(cdtyp,nobs,cdpad)372 CALL chkerr(nf90_inq_varid(ncid,'type', typid) ,cpname, __LINE__ )373 CALL chkerr( nf90_put_var(ncid, typid, cdpad,(/1,1/) , (/ 128, nobs/) ) ,cpname, __LINE__ )374 ! id375 CALL chkerr(nf90_inq_varid(ncid,'id', idvid) ,cpname, __LINE__ )376 CALL chkerr( nf90_put_var(ncid, idvid, cdwmo,(/1,1/) , (/nstr,nobs/) ) ,cpname, __LINE__ )377 ! Close netcdf file378 CALL chkerr( nf90_close(ncid), cpname, __LINE__ )379 380 END SUBROUTINE off_wri_netcdf381 12 382 13 SUBROUTINE yyyymmdd_to_ref_date(indate, intime, outstring) -
branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OPA_SRC/OBS/obs_fbm.F90
r4053 r4091 1564 1564 !! ** Purpose : Write an obfbdata structure into a class 4 file. 1565 1565 !! 1566 !! ** Method : 1. Allocate memory needed by off_wri _netcdf1566 !! ** Method : 1. Allocate memory needed by off_wri 1567 1567 !! 2. Map obfbdata into allocated memory 1568 !! 3. Pass mapped data to off_wri _netcdf1568 !! 3. Pass mapped data to off_wri 1569 1569 !! 4. Deallocate memory 1570 1570 !!----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.