Changeset 7837
- Timestamp:
- 2017-03-27T10:50:24+02:00 (7 years ago)
- Location:
- branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/CONFIG/SHARED/namelist_ref
r7773 r7837 592 592 rn_sponge_tra = 2880. ! coefficient for tracer sponge layer [m2/s] 593 593 rn_sponge_dyn = 2880. ! coefficient for dynamics sponge layer [m2/s] 594 ln_chk_bathy = .FALSE. !595 594 / 596 595 !----------------------------------------------------------------------- … … 1187 1186 !! *** Observation & Assimilation namelists *** 1188 1187 !!====================================================================== 1189 !! namobs observation and model comparison 1188 !! namobs observation and model comparison ('key_diaobs') 1190 1189 !! nam_asminc assimilation increments ('key_asminc') 1191 1190 !!====================================================================== 1192 1191 ! 1193 1192 !----------------------------------------------------------------------- 1194 &namobs ! observation usage switch 1195 !----------------------------------------------------------------------- 1196 ln_diaobs = .false. ! Logical switch for the observation operator 1197 ln_t3d = .false. ! Logical switch for T profile observations 1198 ln_s3d = .false. ! Logical switch for S profile observations 1199 ln_sla = .false. ! Logical switch for SLA observations 1200 ln_sst = .false. ! Logical switch for SST observations 1201 ln_sic = .false. ! Logical switch for Sea Ice observations 1202 ln_vel3d = .false. ! Logical switch for velocity observations 1203 ln_altbias = .false. ! Logical switch for altimeter bias correction 1204 ln_nea = .false. ! Logical switch for rejection of observations near land 1205 ln_grid_global = .true. ! Logical switch for global distribution of observations 1206 ln_grid_search_lookup = .false. ! Logical switch for obs grid search w/lookup table 1207 ln_ignmis = .true. ! Logical switch for ignoring missing files 1208 ln_s_at_t = .false. ! Logical switch for computing model S at T obs if not there 1209 ln_sstnight = .false. ! Logical switch for calculating night-time average for SST obs 1193 &namobs ! observation usage switch ('key_diaobs') 1194 !----------------------------------------------------------------------- 1195 ln_t3d = .false. ! Logical switch for T profile observations 1196 ln_s3d = .false. ! Logical switch for S profile observations 1197 ln_ena = .false. ! Logical switch for ENACT insitu data set 1198 ln_cor = .false. ! Logical switch for Coriolis insitu data set 1199 ln_profb = .false. ! Logical switch for feedback insitu data set 1200 ln_sla = .false. ! Logical switch for SLA observations 1201 ln_sladt = .false. ! Logical switch for AVISO SLA data 1202 ln_slafb = .false. ! Logical switch for feedback SLA data 1203 ln_ssh = .false. ! Logical switch for SSH observations 1204 ln_sst = .false. ! Logical switch for SST observations 1205 ln_reysst = .false. ! Logical switch for Reynolds observations 1206 ln_ghrsst = .false. ! Logical switch for GHRSST observations 1207 ln_sstfb = .false. ! Logical switch for feedback SST data 1208 ln_sss = .false. ! Logical switch for SSS observations 1209 ln_seaice = .false. ! Logical switch for Sea Ice observations 1210 ln_vel3d = .false. ! Logical switch for velocity observations 1211 ln_velavcur= .false ! Logical switch for velocity daily av. cur. 1212 ln_velhrcur= .false ! Logical switch for velocity high freq. cur. 1213 ln_velavadcp = .false. ! Logical switch for velocity daily av. ADCP 1214 ln_velhradcp = .false. ! Logical switch for velocity high freq. ADCP 1215 ln_velfb = .false. ! Logical switch for feedback velocity data 1216 ln_grid_global = .false. ! Global distribtion of observations 1217 ln_grid_search_lookup = .false. ! Logical switch for obs grid search w/lookup table 1218 grid_search_file = 'grid_search' ! Grid search lookup file header 1210 1219 ! All of the *files* variables below are arrays. Use namelist_cfg to add more files 1211 cn_profbfiles = 'profiles_01.nc' ! Profile feedback input observation file names 1212 cn_slafbfiles = 'sla_01.nc' ! SLA feedback input observation file names 1213 cn_sstfbfiles = 'sst_01.nc' ! SST feedback input observation file names 1214 cn_sicfbfiles = 'sic_01.nc' ! SIC feedback input observation file names 1215 cn_velfbfiles = 'vel_01.nc' ! Velocity feedback input observation file names 1216 cn_altbiasfile = 'altbias.nc' ! Altimeter bias input file name 1217 cn_gridsearchfile = 'gridsearch.nc' ! Grid search file name 1218 rn_gridsearchres = 0.5 ! Grid search resolution 1219 rn_dobsini = 00010101.000000 ! Initial date in window YYYYMMDD.HHMMSS 1220 rn_dobsend = 00010102.000000 ! Final date in window YYYYMMDD.HHMMSS 1221 nn_1dint = 0 ! Type of vertical interpolation method 1222 nn_2dint = 0 ! Type of horizontal interpolation method 1223 nn_msshc = 0 ! MSSH correction scheme 1224 rn_mdtcorr = 1.61 ! MDT correction 1225 rn_mdtcutoff = 65.0 ! MDT cutoff for computed correction 1226 nn_profdavtypes = -1 ! Profile daily average types - array 1220 enactfiles = 'enact.nc' ! ENACT input observation file names (specify full array in namelist_cfg) 1221 coriofiles = 'corio.nc' ! Coriolis input observation file name 1222 profbfiles = 'profiles_01.nc' ! Profile feedback input observation file name 1223 ln_profb_enatim = .false ! Enact feedback input time setting switch 1224 slafilesact = 'sla_act.nc' ! Active SLA input observation file names 1225 slafilespas = 'sla_pass.nc' ! Passive SLA input observation file names 1226 slafbfiles = 'sla_01.nc' ! slafbfiles: Feedback SLA input observation file names 1227 sstfiles = 'ghrsst.nc' ! GHRSST input observation file names 1228 sstfbfiles = 'sst_01.nc' ! Feedback SST input observation file names 1229 seaicefiles = 'seaice_01.nc' ! Sea Ice input observation file names 1230 velavcurfiles = 'velavcurfile.nc' ! Vel. cur. daily av. input file name 1231 velhrcurfiles = 'velhrcurfile.nc' ! Vel. cur. high freq. input file name 1232 velavadcpfiles = 'velavadcpfile.nc' ! Vel. ADCP daily av. input file name 1233 velhradcpfiles = 'velhradcpfile.nc' ! Vel. ADCP high freq. input file name 1234 velfbfiles = 'velfbfile.nc' ! Vel. feedback input observation file name 1235 dobsini = 20000101.000000 ! Initial date in window YYYYMMDD.HHMMSS 1236 dobsend = 20010101.000000 ! Final date in window YYYYMMDD.HHMMSS 1237 n1dint = 0 ! Type of vertical interpolation method 1238 n2dint = 0 ! Type of horizontal interpolation method 1239 ln_nea = .false. ! Rejection of observations near land switch 1240 nmsshc = 0 ! MSSH correction scheme 1241 mdtcorr = 1.61 ! MDT correction 1242 mdtcutoff = 65.0 ! MDT cutoff for computed correction 1243 ln_altbias = .false. ! Logical switch for alt bias 1244 ln_ignmis = .true. ! Logical switch for ignoring missing files 1245 endailyavtypes = 820 ! ENACT daily average types - array (use namelist_cfg to set more values) 1246 ln_grid_global = .true. 1247 ln_grid_search_lookup = .false. 1248 ln_sstbias = .false. 1249 sstbias_files = 'sstbias.nc' 1227 1250 / 1228 1251 !----------------------------------------------------------------------- -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90
r7773 r7837 658 658 659 659 DO jk = 1, jpkm1 660 CALL eos_fzp( tsn(:,:,jk,jp_sal), fzptnz(:,:,jk), fsdept(:,:,jk) )660 fzptnz(:,:,jk) = eos_fzp( tsn(:,:,jk,jp_sal), fsdept(:,:,jk) ) 661 661 END DO 662 662 -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90
r7773 r7837 44 44 45 45 !! * Module variables 46 LOGICAL, PUBLIC :: ln_diaobs !: Logical switch for the obs operator 46 LOGICAL, PUBLIC :: & 47 & lk_diaobs = .TRUE. !: Include this for backwards compatibility at NEMO 3.6. 48 LOGICAL :: ln_diaobs !: Logical switch for the obs operator 47 49 LOGICAL :: ln_sstnight !: Logical switch for night mean SST obs 48 50 … … 119 121 & cn_slafbfiles, & ! Sea level anomaly input filenames 120 122 & cn_sicfbfiles, & ! Seaice concentration input filenames 121 & cn_velfbfiles 123 & cn_velfbfiles, & ! Velocity profile input filenames 122 124 & cn_sssfbfiles, & ! Sea surface salinity input filenames 123 125 & cn_logchlfbfiles, & ! Log(Chl) input filenames … … 173 175 & ln_grid_global, ln_grid_search_lookup, & 174 176 & ln_ignmis, ln_s_at_t, ln_bound_reject, & 175 176 ln_sstnight, & 177 & ln_sstnight, & 177 178 & cn_profbfiles, cn_slafbfiles, & 178 179 & cn_sstfbfiles, cn_sicfbfiles, & … … 224 225 IF(lwm) WRITE ( numond, namobs ) 225 226 226 IF ( .NOT. ln_diaobs ) THEN 227 lk_diaobs = .FALSE. 228 #if defined key_diaobs 229 IF ( ln_diaobs ) lk_diaobs = .TRUE. 230 #endif 231 232 IF ( .NOT. lk_diaobs ) THEN 227 233 IF(lwp) WRITE(numout,cform_war) 228 IF(lwp) WRITE(numout,*)' ln_diaobs is set to false so not calling dia_obs'234 IF(lwp) WRITE(numout,*)' ln_diaobs is set to false or key_diaobs is not set, so not calling dia_obs' 229 235 RETURN 230 236 ENDIF 237 231 238 232 239 !----------------------------------------------------------------------- … … 242 249 IF(lwp) WRITE(numout,cform_war) 243 250 IF(lwp) WRITE(numout,*) ' ln_diaobs is set to true, but all obs operator logical flags', & 244 & ' ln_t3d, ln_s3d, ln_sla, ln_sst, ln_sic, ln_vel3d', &245 251 & ' are set to .FALSE. so turning off calls to dia_obs' 246 252 nwarn = nwarn + 1 247 l n_diaobs = .FALSE.253 lk_diaobs = .FALSE. 248 254 RETURN 249 255 ENDIF … … 258 264 IF (ln_t3d .OR. ln_s3d) THEN 259 265 jtype = jtype + 1 260 clproffiles(jtype,:) = cn_profbfiles(:) 261 cobstypesprof(jtype) = 'prof ' 262 ifilesprof(jtype) = 0 263 DO jfile = 1, jpmaxnfiles 264 IF ( trim(clproffiles(jtype,jfile)) /= '' ) & 265 ifilesprof(jtype) = ifilesprof(jtype) + 1 266 END DO 266 CALL obs_settypefiles( nproftypes, jpmaxnfiles, jtype, 'prof ', & 267 & cn_profbfiles, ifilesprof, cobstypesprof, clproffiles ) 267 268 ENDIF 268 269 IF (ln_vel3d) THEN 269 270 jtype = jtype + 1 270 clproffiles(jtype,:) = cn_velfbfiles(:) 271 cobstypesprof(jtype) = 'vel ' 272 ifilesprof(jtype) = 0 273 DO jfile = 1, jpmaxnfiles 274 IF ( trim(clproffiles(jtype,jfile)) /= '' ) & 275 ifilesprof(jtype) = ifilesprof(jtype) + 1 276 END DO 271 CALL obs_settypefiles( nproftypes, jpmaxnfiles, jtype, 'vel ', & 272 & cn_velfbfiles, ifilesprof, cobstypesprof, clproffiles ) 277 273 ENDIF 278 274 … … 288 284 IF (ln_sla) THEN 289 285 jtype = jtype + 1 290 clsurffiles(jtype,:) = cn_slafbfiles(:) 291 cobstypessurf(jtype) = 'sla ' 292 ifilessurf(jtype) = 0 293 DO jfile = 1, jpmaxnfiles 294 IF ( trim(clsurffiles(jtype,jfile)) /= '' ) & 295 ifilessurf(jtype) = ifilessurf(jtype) + 1 296 END DO 286 CALL obs_settypefiles( nsurftypes, jpmaxnfiles, jtype, 'sla ', & 287 & cn_slafbfiles, ifilessurf, cobstypessurf, clsurffiles ) 297 288 ENDIF 298 289 IF (ln_sst) THEN 299 290 jtype = jtype + 1 300 clsurffiles(jtype,:) = cn_sstfbfiles(:) 301 cobstypessurf(jtype) = 'sst ' 302 ifilessurf(jtype) = 0 303 DO jfile = 1, jpmaxnfiles 304 IF ( trim(clsurffiles(jtype,jfile)) /= '' ) & 305 ifilessurf(jtype) = ifilessurf(jtype) + 1 306 END DO 307 ENDIF 308 #if defined key_lim2 || defined key_lim3 291 CALL obs_settypefiles( nsurftypes, jpmaxnfiles, jtype, 'sst ', & 292 & cn_sstfbfiles, ifilessurf, cobstypessurf, clsurffiles ) 293 ENDIF 294 #if defined key_lim2 || defined key_lim3 || defined key_cice 309 295 IF (ln_sic) THEN 310 296 jtype = jtype + 1 311 clsurffiles(jtype,:) = cn_sicfbfiles(:) 312 cobstypessurf(jtype) = 'sic ' 313 ifilessurf(jtype) = 0 314 DO jfile = 1, jpmaxnfiles 315 IF ( trim(clsurffiles(jtype,jfile)) /= '' ) & 316 ifilessurf(jtype) = ifilessurf(jtype) + 1 317 END DO 297 CALL obs_settypefiles( nsurftypes, jpmaxnfiles, jtype, 'sic ', & 298 & cn_sicfbfiles, ifilessurf, cobstypessurf, clsurffiles ) 318 299 ENDIF 319 300 #endif 320 301 IF (ln_sss) THEN 321 302 jtype = jtype + 1 322 clsurffiles(jtype,:) = cn_sssfbfiles(:) 323 cobstypessurf(jtype) = 'sss ' 324 ifilessurf(jtype) = 0 325 DO jfile = 1, jpmaxnfiles 326 IF ( trim(clsurffiles(jtype,jfile)) /= '' ) & 327 ifilessurf(jtype) = ifilessurf(jtype) + 1 328 END DO 303 CALL obs_settypefiles( nsurftypes, jpmaxnfiles, jtype, 'sss ', & 304 & cn_sssfbfiles, ifilessurf, cobstypessurf, clsurffiles ) 329 305 ENDIF 330 306 331 307 IF (ln_logchl) THEN 332 308 jtype = jtype + 1 333 clsurffiles(jtype,:) = cn_logchlfbfiles(:) 334 cobstypessurf(jtype) = 'logchl' 335 ifilessurf(jtype) = 0 336 DO jfile = 1, jpmaxnfiles 337 IF ( trim(clsurffiles(jtype,jfile)) /= '' ) & 338 ifilessurf(jtype) = ifilessurf(jtype) + 1 339 END DO 309 CALL obs_settypefiles( nsurftypes, jpmaxnfiles, jtype, 'logchl', & 310 & cn_logchlfbfiles, ifilessurf, cobstypessurf, clsurffiles ) 340 311 ENDIF 341 312 342 313 IF (ln_spm) THEN 343 314 jtype = jtype + 1 344 clsurffiles(jtype,:) = cn_spmfbfiles(:) 345 cobstypessurf(jtype) = 'spm ' 346 ifilessurf(jtype) = 0 347 DO jfile = 1, jpmaxnfiles 348 IF ( trim(clsurffiles(jtype,jfile)) /= '' ) & 349 ifilessurf(jtype) = ifilessurf(jtype) + 1 350 END DO 315 CALL obs_settypefiles( nsurftypes, jpmaxnfiles, jtype, 'spm ', & 316 & cn_spmfbfiles, ifilessurf, cobstypessurf, clsurffiles ) 351 317 ENDIF 352 318 353 319 IF (ln_fco2) THEN 354 320 jtype = jtype + 1 355 clsurffiles(jtype,:) = cn_fco2fbfiles(:) 356 cobstypessurf(jtype) = 'fco2 ' 357 ifilessurf(jtype) = 0 358 DO jfile = 1, jpmaxnfiles 359 IF ( trim(clsurffiles(jtype,jfile)) /= '' ) & 360 ifilessurf(jtype) = ifilessurf(jtype) + 1 361 END DO 321 CALL obs_settypefiles( nsurftypes, jpmaxnfiles, jtype, 'fco2 ', & 322 & cn_fco2fbfiles, ifilessurf, cobstypessurf, clsurffiles ) 362 323 ENDIF 363 324 364 325 IF (ln_pco2) THEN 365 326 jtype = jtype + 1 366 clsurffiles(jtype,:) = cn_pco2fbfiles(:) 367 cobstypessurf(jtype) = 'pco2 ' 368 ifilessurf(jtype) = 0 369 DO jfile = 1, jpmaxnfiles 370 IF ( trim(clsurffiles(jtype,jfile)) /= '' ) & 371 ifilessurf(jtype) = ifilessurf(jtype) + 1 372 END DO 327 CALL obs_settypefiles( nsurftypes, jpmaxnfiles, jtype, 'pco2 ', & 328 & cn_pco2fbfiles, ifilessurf, cobstypessurf, clsurffiles ) 373 329 ENDIF 374 330 … … 553 509 DO jfile = 1, jpmaxnfiles 554 510 IF ( TRIM(cn_sstbiasfiles(jfile)) /= '' ) & 555 jnumsstbias = jnumsstbias + 1511 & jnumsstbias = jnumsstbias + 1 556 512 END DO 557 513 IF ( jnumsstbias == 0 ) THEN 558 CALL ctl_stop("ln_sstbias set,"// & 559 & " but no bias files to read in") 514 CALL ctl_stop("ln_sstbias set but no bias files to read in") 560 515 ENDIF 561 516 562 517 CALL obs_app_sstbias( surfdataqc(jtype), nn_2dint, & 563 518 & jnumsstbias, cn_sstbiasfiles(1:jnumsstbias) ) 519 520 ENDIF 564 521 565 522 END DO … … 616 573 & frld 617 574 #endif 575 #if defined key_cice 576 USE sbc_oce, ONLY : fr_i ! ice fraction 577 #endif 618 578 #if defined key_hadocc 619 USE trc, ONLY : & 579 USE trc, ONLY : & ! HadOCC chlorophyll, fCO2 and pCO2 620 580 & HADOCC_CHL, & 621 581 & HADOCC_FCO2, & … … 623 583 & HADOCC_FILL_FLT 624 584 #elif defined key_medusa && defined key_foam_medusa 625 USE trc, ONLY : & 585 USE trc, ONLY : & ! MEDUSA chlorophyll, fCO2 and pCO2 626 586 & MEDUSA_CHL, & 627 587 & MEDUSA_FCO2, & … … 633 593 #endif 634 594 #if defined key_spm 635 USE par_spm, ONLY: & 595 USE par_spm, ONLY: & ! ERSEM/SPM sediments 636 596 & jp_spm 637 597 USE trc, ONLY : & … … 648 608 INTEGER :: jvar ! Variable number 649 609 INTEGER :: ji, jj ! Loop counters 610 REAL(wp) :: tiny ! small number 650 611 REAL(wp), POINTER, DIMENSION(:,:,:) :: & 651 612 & zprofvar1, & ! Model values for 1st variable in a prof ob … … 662 623 & zgphi1, & ! Model latitudes for prof variable 1 663 624 & zgphi2 ! Model latitudes for prof variable 2 664 #if ! defined key_lim2 && ! defined key_lim3665 REAL(wp), POINTER, DIMENSION(:,:) :: frld666 #endif667 625 LOGICAL :: llnightav ! Logical for calculating night-time average 626 668 627 669 628 !Allocate local work arrays … … 678 637 CALL wrk_alloc( jpi, jpj, zgphi1 ) 679 638 CALL wrk_alloc( jpi, jpj, zgphi2 ) 680 #if ! defined key_lim2 && ! defined key_lim3681 CALL wrk_alloc(jpi,jpj,frld)682 #endif683 639 684 640 IF(lwp) THEN … … 691 647 idaystp = NINT( rday / rdt ) 692 648 693 !-----------------------------------------------------------------------694 ! No LIM => frld == 0.0_wp695 !-----------------------------------------------------------------------696 #if ! defined key_lim2 && ! defined key_lim3697 frld(:,:) = 0.0_wp698 #endif699 649 !----------------------------------------------------------------------- 700 650 ! Call the profile and surface observation operators … … 724 674 zgphi1(:,:) = gphiu(:,:) 725 675 zgphi2(:,:) = gphiv(:,:) 676 CASE DEFAULT 677 CALL ctl_stop( 'Unknown profile observation type '//TRIM(cobstypesprof(jtype))//' in dia_obs' ) 726 678 END SELECT 727 679 … … 729 681 & nit000, idaystp, & 730 682 & zprofvar1, zprofvar2, & 731 & gdept_1d, zprofmask1, zprofmask2, & 683 & fsdept(:,:,:), fsdepw(:,:,:), & 684 & zprofmask1, zprofmask2, & 732 685 & zglam1, zglam2, zgphi1, zgphi2, & 733 686 & nn_1dint, nn_2dint, & … … 754 707 CASE('sss') 755 708 zsurfvar(:,:) = tsn(:,:,1,jp_sal) 756 #if defined key_lim2 || defined key_lim3757 709 CASE('sic') 758 710 IF ( kstp == 0 ) THEN … … 767 719 CYCLE 768 720 ELSE 721 #if defined key_cice 722 zsurfvar(:,:) = fr_i(:,:) 723 #elif defined key_lim2 || defined key_lim3 769 724 zsurfvar(:,:) = 1._wp - frld(:,:) 725 #else 726 CALL ctl_stop( ' Trying to run sea-ice observation operator', & 727 & ' but no sea-ice model appears to have been defined' ) 728 #endif 770 729 ENDIF 771 #endif 730 772 731 CASE('logchl') 773 732 #if defined key_hadocc … … 879 838 #endif 880 839 840 CASE DEFAULT 841 842 CALL ctl_stop( 'Unknown surface observation type '//TRIM(cobstypessurf(jtype))//' in dia_obs' ) 843 881 844 END SELECT 882 845 … … 899 862 CALL wrk_dealloc( jpi, jpj, zgphi1 ) 900 863 CALL wrk_dealloc( jpi, jpj, zgphi2 ) 901 #if ! defined key_lim2 && ! defined key_lim3902 CALL wrk_dealloc(jpi,jpj,frld)903 #endif904 864 905 865 END SUBROUTINE dia_obs … … 1184 1144 END SUBROUTINE fin_date 1185 1145 1146 SUBROUTINE obs_settypefiles( ntypes, jpmaxnfiles, jtype, ctypein, & 1147 & cfilestype, ifiles, cobstypes, cfiles ) 1148 1149 INTEGER, INTENT(IN) :: ntypes ! Total number of obs types 1150 INTEGER, INTENT(IN) :: jpmaxnfiles ! Maximum number of files allowed for each type 1151 INTEGER, INTENT(IN) :: jtype ! Index of the current type of obs 1152 INTEGER, DIMENSION(ntypes), INTENT(INOUT) :: & 1153 & ifiles ! Out appended number of files for this type 1154 1155 CHARACTER(len=6), INTENT(IN) :: ctypein 1156 CHARACTER(len=128), DIMENSION(jpmaxnfiles), INTENT(IN) :: & 1157 & cfilestype ! In list of files for this obs type 1158 CHARACTER(len=6), DIMENSION(ntypes), INTENT(INOUT) :: & 1159 & cobstypes ! Out appended list of obs types 1160 CHARACTER(len=128), DIMENSION(ntypes, jpmaxnfiles), INTENT(INOUT) :: & 1161 & cfiles ! Out appended list of files for all types 1162 1163 !Local variables 1164 INTEGER :: jfile 1165 1166 cfiles(jtype,:) = cfilestype(:) 1167 cobstypes(jtype) = ctypein 1168 ifiles(jtype) = 0 1169 DO jfile = 1, jpmaxnfiles 1170 IF ( trim(cfiles(jtype,jfile)) /= '' ) & 1171 ifiles(jtype) = ifiles(jtype) + 1 1172 END DO 1173 1174 IF ( ifiles(jtype) == 0 ) THEN 1175 CALL ctl_stop( 'Logical for observation type '//TRIM(ctypein)// & 1176 & ' set to true but no files available to read' ) 1177 ENDIF 1178 1179 END SUBROUTINE obs_settypefiles 1180 1186 1181 END MODULE diaobs -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/obs_oper.F90
r7773 r7837 31 31 USE sbcdcy, ONLY : & ! For calculation of where it is night-time 32 32 & sbc_dcy, nday_qsr 33 USE obs_grid, ONLY : & 34 & obs_level_search 33 35 34 36 IMPLICIT NONE … … 53 55 CONTAINS 54 56 57 55 58 SUBROUTINE obs_prof_opt( prodatqc, kt, kpi, kpj, kpk, & 56 59 & kit000, kdaystp, & 57 & pvar1, pvar2, pgdept, pgdepw, 58 & pmask1, pmask2, &60 & pvar1, pvar2, pgdept, pgdepw, & 61 & pmask1, pmask2, & 59 62 & plam1, plam2, pphi1, pphi2, & 60 63 & k1dint, k2dint, kdailyavtypes ) … … 154 157 INTEGER :: iend 155 158 INTEGER :: iobs 159 INTEGER :: iin, ijn, ikn, ik ! looping indices over interpolation nodes 160 INTEGER :: inum_obs 156 161 INTEGER, DIMENSION(imaxavtypes) :: & 157 162 & idailyavtypes … … 161 166 & igrdj1, & 162 167 & igrdj2 168 INTEGER, ALLOCATABLE, DIMENSION(:) :: iv_indic 169 163 170 REAL(KIND=wp) :: zlam 164 171 REAL(KIND=wp) :: zphi … … 188 195 & zgphi2 189 196 REAL(KIND=wp), DIMENSION(1) :: zmsk_1, zmsk_2 190 REAL(KIND=wp), DIMENSION(:,:,:), ALLOCATABLE :: interp_corner 197 REAL(KIND=wp), DIMENSION(:,:,:), ALLOCATABLE :: interp_corner 191 198 192 199 LOGICAL :: ld_dailyav … … 627 634 628 635 ENDIF 636 637 ENDDO 629 638 630 639 ! Deallocate the data for interpolation -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/obs_prep.F90
r7773 r7837 46 46 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 47 47 !!---------------------------------------------------------------------- 48 49 !! * Substitutions 50 # include "domzgr_substitute.h90" 48 51 49 52 CONTAINS … … 1236 1239 CALL obs_int_comm_2d( 2, 2, kprofno, kpi, kpj, igrdi, igrdj, plam, zglam ) 1237 1240 CALL obs_int_comm_2d( 2, 2, kprofno, kpi, kpj, igrdi, igrdj, pphi, zgphi ) 1241 ! Need to know the bathy depth for each observation for sco 1242 CALL obs_int_comm_3d( 2, 2, kprofno, kpi, kpj, kpk, igrdi, igrdj, fsdepw(:,:,:), & 1243 & zgdepw ) 1238 1244 1239 1245 DO jobs = 1, kprofno -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/obs_profiles_def.F90
r7773 r7837 104 104 ! Bookkeeping arrays with sizes equal to number of variables 105 105 106 CHARACTER(len= 6), POINTER, DIMENSION(:) :: &106 CHARACTER(len=8), POINTER, DIMENSION(:) :: & 107 107 & cvars !: Variable names 108 108 -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_prof.F90
r7773 r7837 87 87 CHARACTER(LEN=15), PARAMETER :: cpname='obs_rea_prof' 88 88 CHARACTER(len=8) :: clrefdate 89 CHARACTER(len= 6), DIMENSION(:), ALLOCATABLE :: clvars89 CHARACTER(len=8), DIMENSION(:), ALLOCATABLE :: clvars 90 90 INTEGER :: jvar 91 91 INTEGER :: ji -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_surf.F90
r7740 r7837 77 77 CHARACTER(LEN=11), PARAMETER :: cpname='obs_rea_surf' 78 78 CHARACTER(len=8) :: clrefdate 79 CHARACTER(len= 6), DIMENSION(:), ALLOCATABLE :: clvars79 CHARACTER(len=8), DIMENSION(:), ALLOCATABLE :: clvars 80 80 INTEGER :: ji 81 81 INTEGER :: jj … … 172 172 173 173 !------------------------------------------------------------------ 174 ! Read the profile file into inpfiles174 ! Read the surface file into inpfiles 175 175 !------------------------------------------------------------------ 176 176 CALL init_obfbdata( inpfiles(jj) ) … … 196 196 END DO 197 197 ENDIF 198 199 IF (lwp) WRITE(numout,*)'Observation file contains ',inpfiles(jj)%nobs,' observations'200 198 201 199 !------------------------------------------------------------------ … … 347 345 348 346 iobs = 0 349 350 347 surfdata%cvars(:) = clvars(:) 351 348 -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/obs_sstbias.F90
r7773 r7837 49 49 !! History : 50 50 !! ! : 2014-08 (J. While) Bias correction code for SST obs, 51 !! ! based on obs_rea_altbias51 !! ! based on obs_rea_altbias 52 52 !!---------------------------------------------------------------------- 53 53 !! * Modules used … … 69 69 INTEGER :: jpisstbias ! Number of grid point in latitude for the bias 70 70 INTEGER :: jpjsstbias ! Number of grid point in longitude for the bias 71 INTEGER :: iico ! Grid point indices72 INTEGER :: ijco73 71 INTEGER :: jt 74 72 INTEGER :: i_nx_id ! Index to read the NetCDF file … … 129 127 CALL iom_open( cl_bias_files(jtype), numsstbias, ldstop=.FALSE. ) 130 128 131 IF (numsstbias .GT.0) THEN129 IF (numsstbias > 0) THEN 132 130 133 131 !Read the bias type from the file … … 137 135 iret=NF90_OPEN(TRIM(cl_bias_files(jtype)), NF90_NOWRITE, incfile) 138 136 iret=NF90_GET_ATT( incfile, NF90_GLOBAL, "SST_source", & 139 ifile_source )137 ifile_source ) 140 138 ibiastypes(jtype) = ifile_source 141 139 iret=NF90_CLOSE(incfile) … … 151 149 ! Close the file 152 150 CALL iom_close(numsstbias) 153 151 IF ( lwp ) WRITE(numout,*) 'Read in bias for type: ',ibiastypes(jtype) 154 152 ELSE 155 153 CALL ctl_stop('obs_read_sstbias: File '// & … … 178 176 END DO 179 177 180 CALL obs_int_comm_2d( 2, 2, sstdata%nsurf, &178 CALL obs_int_comm_2d( 2, 2, sstdata%nsurf, jpi, jpj, & 181 179 & igrdi, igrdj, glamt, zglam ) 182 CALL obs_int_comm_2d( 2, 2, sstdata%nsurf, &180 CALL obs_int_comm_2d( 2, 2, sstdata%nsurf, jpi, jpj, & 183 181 & igrdi, igrdj, gphit, zgphi ) 184 CALL obs_int_comm_2d( 2, 2, sstdata%nsurf, &182 CALL obs_int_comm_2d( 2, 2, sstdata%nsurf, jpi, jpj, & 185 183 & igrdi, igrdj, tmask(:,:,1), zmask ) 186 184 187 185 DO jtype = 1, knumtypes 188 186 189 !Find the number observations of t ype190 !and all locate tempory arrays187 !Find the number observations of this type 188 !and allocate tempory arrays 191 189 inumtype = COUNT( sstdata%ntyp(:) == ibiastypes(jtype) ) 192 190 … … 199 197 & zbias( 2,2,inumtype ) ) 200 198 199 IF ( lwp ) WRITE(numout,*) 'Number of obs of type: ',ibiastypes(jtype),' is: ',inumtype 200 201 201 jt=1 202 202 DO jobs = 1, sstdata%nsurf … … 207 207 zglam_tmp(:,:,jt) = zglam(:,:,jobs) 208 208 zgphi_tmp(:,:,jt) = zgphi(:,:,jobs) 209 zgphi_tmp(:,:,jt) = zgphi(:,:,jobs)210 209 zmask_tmp(:,:,jt) = zmask(:,:,jobs) 211 210 … … 215 214 END DO 216 215 217 CALL obs_int_comm_2d( 2, 2, inumtype, &216 CALL obs_int_comm_2d( 2, 2, inumtype, jpi, jpj, & 218 217 & igrdi_tmp(:,:,:), igrdj_tmp(:,:,:), & 219 218 & z_sstbias(:,:,jtype), zbias(:,:,:) ) … … 225 224 zlam = sstdata%rlam(jobs) 226 225 zphi = sstdata%rphi(jobs) 227 iico = sstdata%mi(jobs) 228 ijco = sstdata%mj(jobs) 229 230 CALL obs_int_h2d_init( 1, 1, k2dint, zlam, zphi, & 231 & zglam_tmp(:,:,jt), & 232 & zgphi_tmp(:,:,jt), & 226 227 CALL obs_int_h2d_init( 1, 1, k2dint, zlam, zphi, & 228 & zglam_tmp(:,:,jt), zgphi_tmp(:,:,jt), & 233 229 & zmask_tmp(:,:,jt), zweig, zobsmask ) 234 230 … … 236 232 237 233 ! adjust sst with bias field 238 sstdata%robs(jobs,1) = & 239 & sstdata%robs(jobs,1) - zext(1) 234 sstdata%robs(jobs,1) = sstdata%robs(jobs,1) - zext(1) 240 235 241 236 jt=jt+1 … … 243 238 ENDIF 244 239 END DO 245 240 241 IF ( lwp ) THEN 242 WRITE(numout,*) 'Applied bias to obs of type: ',ibiastypes(jtype) 243 WRITE(numout,*) 'Max/min of bias: ', maxval(zbias(:,:,:)), minval(zbias(:,:,:)) 244 ENDIF 245 246 246 !Deallocate arrays 247 247 DEALLOCATE( & -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/obs_surf_def.F90
r7776 r7837 69 69 & ntyp !: Type of surface observation product 70 70 71 CHARACTER(len= 6), POINTER, DIMENSION(:) :: &71 CHARACTER(len=8), POINTER, DIMENSION(:) :: & 72 72 & cvars !: Variable names 73 73 -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/obs_write.F90
r7776 r7837 395 395 END DO 396 396 397 CASE('ICECON ')397 CASE('ICECONC') 398 398 399 399 CALL alloc_obfbdata( fbdata, 1, surfdata%nsurf, 1, & … … 532 532 fbdata%caddunit(1+ja,1) = padd%cdunit(ja,1) 533 533 END DO 534 535 CASE DEFAULT 536 537 CALL ctl_stop( 'Unknown observation type '//TRIM(surfdata%cvars(1))//' in obs_wri_surf' ) 534 538 535 539 END SELECT -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_if.F90
r7773 r7837 103 103 ! ( d rho / dt ) / ( d rho / ds ) ( s = 34, t = -1.8 ) 104 104 105 CALL eos_fzp( sss_m(:,:), fr_i(:,:) ) ! sea surface freezing temperature [Celcius] 106 fr_i(:,:) = fr_i(:,:) * tmask(:,:,1) 105 fr_i(:,:) = eos_fzp( sss_m ) * tmask(:,:,1) ! sea surface freezing temperature [Celcius] 107 106 108 107 IF( ln_cpl ) a_i(:,:,1) = fr_i(:,:) -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90
r7773 r7837 150 150 151 151 ! ... masked sea surface freezing temperature [Kelvin] (set to rt0 over land) 152 CALL eos_fzp( sss_m(:,:), tfu(:,:) ) 153 tfu(:,:) = tfu(:,:) + rt0 152 tfu(:,:) = eos_fzp( sss_m ) + rt0 154 153 155 154 zsist (:,:,1) = sist (:,:) + rt0 * ( 1. - tmask(:,:,1) ) -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90
r7776 r7837 54 54 REAL(wp) , PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:) :: ttbl, stbl, utbl, vtbl !:top boundary layer variable at T point 55 55 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:) :: misfkt, misfkb !:Level of ice shelf base 56 56 57 57 58 REAL(wp), PUBLIC, SAVE :: rcpi = 2000.0_wp ! phycst ? … … 369 370 ! Calculate freezing temperature 370 371 zpress = grav*rau0*fsdept(ji,jj,ik)*1.e-04 371 CALL eos_fzp(tsb(ji,jj,ik,jp_sal), zt_frz, zpress)372 zt_frz = eos_fzp(tsb(ji,jj,ik,jp_sal), zpress) 372 373 zt_sum = zt_sum + (tsn(ji,jj,ik,jp_tem)-zt_frz) * fse3t(ji,jj,ik) * tmask(ji,jj,ik) ! sum temp 373 374 ENDDO … … 451 452 zti(:,:)=tinsitu( ttbl, stbl, zpress ) 452 453 ! Calculate freezing temperature 453 CALL eos_fzp( sss_m(:,:), zfrz(:,:), zpress )454 zfrz(:,:)=eos_fzp( sss_m(:,:), zpress ) 454 455 455 456 -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90
r7773 r7837 173 173 END DO 174 174 END DO 175 CALL eos_fzp( tsn(:,:,1,jp_sal), zfzp(:,:), zpres(:,:) )175 zfzp(:,:) = eos_fzp( tsn(:,:,1,jp_sal), zpres(:,:) ) 176 176 DO jk = 1, jpk 177 177 DO jj = 1, jpj -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90
r7773 r7837 174 174 !!---------------------------------------------------------------------- 175 175 ! 176 #if defined key_agrif177 ! interpolation parent grid => child grid for avm_k ( ex : at west border: update column 1 and 2)178 IF( .NOT.Agrif_Root() ) CALL Agrif_Tke179 #endif180 !181 176 IF( kt /= nit000 ) THEN ! restore before value to compute tke 182 177 avt (:,:,:) = avt_k (:,:,:) … … 234 229 INTEGER , POINTER, DIMENSION(:,: ) :: imlc 235 230 REAL(wp), POINTER, DIMENSION(:,: ) :: zhlc 236 REAL(wp), POINTER, DIMENSION(:,:,:) :: zpelc, zdiag, zd_up, zd_lw, z3du, z3dv 237 REAL(wp) :: zri ! local Richardson number 231 REAL(wp), POINTER, DIMENSION(:,:,:) :: zpelc, zdiag, zd_up, zd_lw 238 232 !!-------------------------------------------------------------------- 239 233 ! … … 242 236 CALL wrk_alloc( jpi,jpj, imlc ) ! integer 243 237 CALL wrk_alloc( jpi,jpj, zhlc ) 244 CALL wrk_alloc( jpi,jpj,jpk, zpelc, zdiag, zd_up, zd_lw , z3du, z3dv)238 CALL wrk_alloc( jpi,jpj,jpk, zpelc, zdiag, zd_up, zd_lw ) 245 239 ! 246 240 zbbrau = rn_ebb / rau0 ! Local constant initialisation … … 367 361 zzd_lw = zcof * ( avm (ji,jj,jk ) + avm (ji,jj,jk-1) ) & ! lower diagonal 368 362 & / ( fse3t(ji,jj,jk-1) * fse3w(ji,jj,jk ) ) 369 !! shear prod. at w-point weightened by mask370 zesh2 = ( z3du(ji-1,jj,jk) + z3du(ji,jj,jk) ) / MAX( 1._wp , umask(ji-1,jj,jk) + umask(ji,jj,jk) ) &371 & + ( z3dv(ji,jj-1,jk) + z3dv(ji,jj,jk) ) / MAX( 1._wp , vmask(ji,jj-1,jk) + vmask(ji,jj,jk) )372 !363 ! ! shear prod. at w-point weightened by mask 364 zesh2 = ( avmu(ji-1,jj,jk) + avmu(ji,jj,jk) ) / MAX( 1._wp , umask(ji-1,jj,jk) + umask(ji,jj,jk) ) & 365 & + ( avmv(ji,jj-1,jk) + avmv(ji,jj,jk) ) / MAX( 1._wp , vmask(ji,jj-1,jk) + vmask(ji,jj,jk) ) 366 ! 373 367 zd_up(ji,jj,jk) = zzd_up ! Matrix (zdiag, zd_up, zd_lw) 374 368 zd_lw(ji,jj,jk) = zzd_lw … … 468 462 CALL wrk_dealloc( jpi,jpj, imlc ) ! integer 469 463 CALL wrk_dealloc( jpi,jpj, zhlc ) 470 CALL wrk_dealloc( jpi,jpj,jpk, zpelc, zdiag, zd_up, zd_lw , z3du, z3dv)464 CALL wrk_dealloc( jpi,jpj,jpk, zpelc, zdiag, zd_up, zd_lw ) 471 465 ! 472 466 IF( nn_timing == 1 ) CALL timing_stop('tke_tke') … … 512 506 INTEGER :: ji, jj, jk ! dummy loop indices 513 507 REAL(wp) :: zrn2, zraug, zcoef, zav ! local scalars 514 REAL(wp) :: zdku, z ri, zsqen ! - -508 REAL(wp) :: zdku, zpdlr, zri, zsqen ! - - 515 509 REAL(wp) :: zdkv, zemxl, zemlm, zemlp ! - - 516 510 REAL(wp), POINTER, DIMENSION(:,:,:) :: zmpdl, zmxlm, zmxld -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
r7773 r7837 176 176 #endif 177 177 178 IF( l n_diaobs ) CALL dia_obs_wri178 IF( lk_diaobs ) CALL dia_obs_wri 179 179 ! 180 180 IF( ln_icebergs ) CALL icb_end( nitend ) … … 467 467 CALL dia_hsb_init ! heat content, salt content and volume budgets 468 468 CALL trd_init ! Mixed-layer/Vorticity/Integral constraints trends 469 IF( lk_diaobs ) THEN ! Observation & model comparison 469 470 CALL dia_obs_init ! Initialize observational data 470 IF( ln_diaobs )CALL dia_obs( nit000 - 1 ) ! Observation operator for restart471 471 CALL dia_obs( nit000 - 1 ) ! Observation operator for restart 472 ENDIF 472 473 ! ! Assimilation increments 473 474 IF( lk_asminc ) CALL asm_inc_init ! Initialize assimilation increments -
branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/OPA_SRC/step.F90
r7773 r7837 354 354 #endif 355 355 IF( ln_diahsb ) CALL dia_hsb( kstp ) ! - ML - global conservation diagnostics 356 IF( l n_diaobs ) CALL dia_obs( kstp ) ! obs-minus-model (assimilation) diagnostics (call after dynamics update)356 IF( lk_diaobs ) CALL dia_obs( kstp ) ! obs-minus-model (assimilation) diagnostics (call after dynamics update) 357 357 358 358 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Note: See TracChangeset
for help on using the changeset viewer.