Changeset 6854 for branches/UKMO/dev_r4650_general_vert_coord_obsoper_surf_bgc/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90
- Timestamp:
- 2016-08-08T12:26:45+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_r4650_general_vert_coord_obsoper_surf_bgc/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90
r6406 r6854 21 21 USE par_oce 22 22 USE dom_oce ! Ocean space and time domain variables 23 USE obs_const, ONLY: obfillflt ! Fill value 23 24 USE obs_fbm, ONLY: ln_cl4 ! Class 4 diagnostic switch 24 25 USE obs_read_prof ! Reading and allocation of observations (Coriolis) … … 29 30 USE obs_read_seaice ! Reading and allocation of Sea Ice observations 30 31 USE obs_read_vel ! Reading and allocation of velocity component observations 32 USE obs_read_logchl ! Reading and allocation of logchl observations 31 33 USE obs_prep ! Preparation of obs. (grid search etc). 32 34 USE obs_oper ! Observation operators … … 40 42 USE obs_sst ! SST data storage 41 43 USE obs_seaice ! Sea Ice data storage 44 USE obs_logchl ! logchl data storage 42 45 USE obs_types ! Definitions for observation types 43 46 USE mpp_map ! MPP mapping … … 81 84 LOGICAL, PUBLIC :: ln_velhradcp !: Logical switch for raw high freq netCDF ADCP vel. data 82 85 LOGICAL, PUBLIC :: ln_velfb !: Logical switch for velocities from feedback files 86 LOGICAL, PUBLIC :: ln_logchl !: Logical switch for log10(chlorophyll) 87 LOGICAL, PUBLIC :: ln_logchlfb !: Logical switch for logchl from feedback files 83 88 LOGICAL, PUBLIC :: ln_ssh !: Logical switch for sea surface height 84 89 LOGICAL, PUBLIC :: ln_sss !: Logical switch for sea surface salinity … … 164 169 CHARACTER(len=128) :: velhradcpfiles(MaxNumFiles) 165 170 CHARACTER(len=128) :: velfbfiles(MaxNumFiles) 171 CHARACTER(len=128) :: logchlfiles(MaxNumFiles) 172 CHARACTER(len=128) :: logchlfbfiles(MaxNumFiles) 166 173 CHARACTER(LEN=128) :: reysstname 167 174 CHARACTER(LEN=12) :: reysstfmt … … 188 195 & ln_velhradcp, velhradcpfiles, & 189 196 & ln_velfb, velfbfiles, ln_velfb_av, & 197 & ln_logchl, ln_logchlfb, & 198 & logchlfiles, logchlfbfiles, & 190 199 & ln_profb_enatim, ln_ignmis, ln_cl4, & 191 200 & ln_sstbias, sstbias_files … … 209 218 INTEGER :: jnumvelhradcp 210 219 INTEGER :: jnumvelfb 220 INTEGER :: jnumlogchl 221 INTEGER :: jnumlogchlfb 211 222 INTEGER :: ji 212 223 INTEGER :: jset … … 217 228 ! Read namelist parameters 218 229 !----------------------------------------------------------------------- 230 231 ln_logchl = .FALSE. 232 ln_logchlfb = .FALSE. 219 233 220 234 !Initalise all values in namelist arrays … … 237 251 velcurfiles(:) = '' 238 252 veladcpfiles(:) = '' 253 logchlfiles(:) = '' 254 logchlfbfiles(:) = '' 239 255 sstbias_files(:) = '' 240 256 endailyavtypes(:) = -1 … … 335 351 jnumvelfb = COUNT(lmask) 336 352 lmask(:) = .FALSE. 353 ENDIF 354 IF (ln_logchl) THEN 355 lmask(:) = .FALSE. 356 WHERE (logchlfiles(:) /= '') lmask(:) = .TRUE. 357 jnumlogchl = COUNT(lmask) 358 ENDIF 359 IF (ln_logchlfb) THEN 360 lmask(:) = .FALSE. 361 WHERE (logchlfbfiles(:) /= '') lmask(:) = .TRUE. 362 jnumlogchlfb = COUNT(lmask) 337 363 ENDIF 338 364 … … 366 392 WRITE(numout,*) ' Logical switch for velocity high freq. ADCP ln_velhradcp = ', ln_velhradcp 367 393 WRITE(numout,*) ' Logical switch for feedback velocity data ln_velfb = ', ln_velfb 394 WRITE(numout,*) ' Logical switch for logchl observations ln_logchl = ', ln_logchl 395 WRITE(numout,*) ' Logical switch for feedback logchl data ln_logchlfb = ', ln_logchlfb 368 396 WRITE(numout,*) ' Global distribtion of observations ln_grid_global = ',ln_grid_global 369 397 WRITE(numout,*) & … … 462 490 TRIM(velfbfiles(ji)) 463 491 ENDIF 492 END DO 493 ENDIF 494 IF (ln_logchl) THEN 495 DO ji = 1, jnumlogchl 496 WRITE(numout,'(1X,2A)') ' logchl input observation file name logchlfiles = ', & 497 TRIM(logchlfiles(ji)) 498 END DO 499 ENDIF 500 IF (ln_logchlfb) THEN 501 DO ji = 1, jnumlogchlfb 502 WRITE(numout,'(1X,2A)') ' Feedback logchl input observation file name logchlfbfiles = ', & 503 TRIM(logchlfbfiles(ji)) 464 504 END DO 465 505 ENDIF … … 498 538 & ( .NOT. ln_vel3d ).AND. & 499 539 & ( .NOT. ln_ssh ).AND.( .NOT. ln_sst ).AND.( .NOT. ln_sss ).AND. & 500 & ( .NOT. ln_seaice ).AND.( .NOT. ln_vel3d ) ) THEN540 & ( .NOT. ln_seaice ).AND.( .NOT. ln_vel3d ).AND.( .NOT. ln_logchl ) ) THEN 501 541 IF(lwp) WRITE(numout,cform_war) 502 542 IF(lwp) WRITE(numout,*) ' key_diaobs is activated but logical flags', & 503 & ' ln_t3d, ln_s3d, ln_sla, ln_ssh, ln_sst, ln_sss, ln_seaice, ln_vel3d are all set to .FALSE.' 543 & ' ln_t3d, ln_s3d, ln_sla, ln_ssh, ln_sst, ln_sss, ln_seaice, ln_vel3d,', & 544 & ' ln_logchl are all set to .FALSE.' 504 545 nwarn = nwarn + 1 505 546 ENDIF … … 999 1040 1000 1041 ENDIF 1042 1043 ! - log10(chlorophyll) 1044 1045 IF ( ln_logchl ) THEN 1046 1047 ! Set the number of variables for logchl to 1 1048 nlogchlvars = 1 1049 1050 ! Set the number of extra variables for logchl to 0 1051 nlogchlextr = 0 1052 1053 IF ( ln_logchlfb ) THEN 1054 nlogchlsets = jnumlogchlfb 1055 ELSE 1056 nlogchlsets = 1 1057 ENDIF 1058 1059 ALLOCATE(logchldata(nlogchlsets)) 1060 ALLOCATE(logchldatqc(nlogchlsets)) 1061 logchldata(:)%nsurf=0 1062 logchldatqc(:)%nsurf=0 1063 1064 nlogchlsets = 0 1065 1066 IF ( ln_logchlfb ) THEN ! Feedback file format 1067 1068 DO jset = 1, jnumlogchlfb 1069 1070 nlogchlsets = nlogchlsets + 1 1071 1072 CALL obs_rea_logchl( 0, logchldata(nlogchlsets), 1, & 1073 & logchlfbfiles(jset:jset), & 1074 & nlogchlvars, nlogchlextr, nitend-nit000+2, & 1075 & dobsini, dobsend, ln_ignmis, .FALSE. ) 1076 1077 CALL obs_pre_logchl( logchldata(nlogchlsets), logchldatqc(nlogchlsets), & 1078 & ln_logchl, ln_nea ) 1079 1080 ENDDO 1081 1082 ELSE ! Original file format 1083 1084 nlogchlsets = nlogchlsets + 1 1085 1086 CALL obs_rea_logchl( 1, logchldata(nlogchlsets), jnumlogchl, & 1087 & logchlfiles(1:jnumlogchl), & 1088 & nlogchlvars, nlogchlextr, nitend-nit000+2, & 1089 & dobsini, dobsend, ln_ignmis, .FALSE. ) 1090 1091 CALL obs_pre_logchl( logchldata(nlogchlsets), logchldatqc(nlogchlsets), & 1092 & ln_logchl, ln_nea ) 1093 1094 ENDIF 1095 1096 ENDIF 1001 1097 1002 1098 END SUBROUTINE dia_obs_init … … 1016 1112 !! - Sea surface salinity 1017 1113 !! - Velocity component (U,V) profiles 1114 !! - Sea surface log10(chlorophyll) 1018 1115 !! 1019 1116 !! ** Action : … … 1053 1150 & frld 1054 1151 #endif 1152 #if defined key_hadocc 1153 USE trc, ONLY : & ! HadOCC chlorophyll 1154 & HADOCC_CHL, & 1155 & HADOCC_FILL_FLT 1156 #elif defined key_medusa && defined key_foam_medusa 1157 USE trc, ONLY : & ! MEDUSA chlorophyll 1158 & MEDUSA_CHL, & 1159 & MEDUSA_FILL_FLT 1160 #elif defined key_fabm 1161 !USE ??? ! ERSEM chlorophyll 1162 #endif 1055 1163 IMPLICIT NONE 1056 1164 … … 1064 1172 INTEGER :: jseaiceset ! sea ice data set loop variable 1065 1173 INTEGER :: jveloset ! velocity profile data loop variable 1174 INTEGER :: jlogchlset ! logchl data set loop variable 1066 1175 INTEGER :: jvar ! Variable number 1067 1176 #if ! defined key_lim2 && ! defined key_lim3 1068 1177 REAL(wp), POINTER, DIMENSION(:,:) :: frld 1069 1178 #endif 1179 REAL(wp) :: tiny ! small number 1180 REAL(wp), DIMENSION(jpi,jpj) :: & 1181 logchl ! array for log chlorophyll 1182 REAL(wp), DIMENSION(jpi,jpj) :: & 1183 maskchl ! array for special chlorophyll mask 1070 1184 CHARACTER(LEN=20) :: datestr=" ",timestr=" " 1071 1185 … … 1177 1291 ENDIF 1178 1292 1293 IF ( ln_logchl ) THEN 1294 1295 #if defined key_hadocc 1296 logchl(:,:) = HADOCC_CHL(:,:,1) ! (not log) chlorophyll from HadOCC 1297 #elif defined key_medusa && defined key_foam_medusa 1298 logchl(:,:) = MEDUSA_CHL(:,:,1) ! (not log) chlorophyll from HadOCC 1299 #elif defined key_fabm 1300 !logchl(:,:) = ??? ! (not log) chlorophyll from ERSEM 1301 CALL ctl_stop( ' Trying to run logchl observation operator', & 1302 & ' but not properly implemented for FABM-ERSEM yet' ) 1303 #else 1304 CALL ctl_stop( ' Trying to run logchl observation operator', & 1305 & ' but no biogeochemical model appears to have been defined' ) 1306 #endif 1307 1308 maskchl(:,:) = tmask(:,:,1) ! create a special mask to exclude certain things 1309 1310 ! Take the log10 where we can, otherwise exclude 1311 tiny = 1.0e-20 1312 WHERE(logchl(:,:) > tiny .AND. logchl(:,:) /= obfillflt ) 1313 logchl(:,:) = LOG10(logchl(:,:)) 1314 ELSEWHERE 1315 logchl(:,:) = obfillflt 1316 maskchl(:,:) = 0 1317 END WHERE 1318 1319 DO jlogchlset = 1, nlogchlsets 1320 CALL obs_logchl_opt( logchldatqc(jlogchlset), & 1321 & kstp, jpi, jpj, nit000, logchl(:,:), & 1322 & maskchl(:,:), n2dint ) 1323 END DO 1324 ENDIF 1325 1179 1326 #if ! defined key_lim2 && ! defined key_lim3 1180 1327 CALL wrk_dealloc(jpi,jpj,frld) … … 1209 1356 INTEGER :: jsstset ! SST data set loop variable 1210 1357 INTEGER :: jseaiceset ! Sea Ice data set loop variable 1358 INTEGER :: jlogchlset ! logchl data set loop variable 1211 1359 INTEGER :: jset 1212 1360 INTEGER :: jfbini … … 1453 1601 ENDIF 1454 1602 1603 ENDIF 1604 1605 ! - log10(chlorophyll) 1606 IF ( ln_logchl ) THEN 1607 1608 ! Copy data from logchldatqc to logchldata structures 1609 DO jlogchlset = 1, nlogchlsets 1610 1611 CALL obs_surf_decompress( logchldatqc(jlogchlset), & 1612 & logchldata(jlogchlset), .TRUE., numout ) 1613 1614 END DO 1615 1616 ! Mark as bad observations with no valid model counterpart due to activities in dia_obs 1617 ! Seem to need to set to fill value rather than marking as bad to be effective, so do both 1618 DO jlogchlset = 1, nlogchlsets 1619 WHERE ( logchldata(jlogchlset)%rmod(:,1) == obfillflt ) 1620 logchldata(jlogchlset)%nqc(:) = 1 1621 logchldata(jlogchlset)%robs(:,1) = obfillflt 1622 END WHERE 1623 END DO 1624 1625 ! Write the logchl data 1626 DO jlogchlset = 1, nlogchlsets 1627 1628 WRITE(cdtmp,'(A,I2.2)')'logchlfb_',jlogchlset 1629 CALL obs_wri_logchl( cdtmp, logchldata(jlogchlset) ) 1630 1631 END DO 1632 1455 1633 ENDIF 1456 1634
Note: See TracChangeset
for help on using the changeset viewer.