Changeset 6856 for branches/UKMO/dev_r4650_general_vert_coord_obsoper_surf_bgc/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90
- Timestamp:
- 2016-08-08T17:22:29+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
r6855 r6856 32 32 USE obs_read_logchl ! Reading and allocation of logchl observations 33 33 USE obs_read_spm ! Reading and allocation of spm observations 34 USE obs_read_fco2 ! Reading and allocation of fco2 observations 34 35 USE obs_prep ! Preparation of obs. (grid search etc). 35 36 USE obs_oper ! Observation operators … … 45 46 USE obs_logchl ! logchl data storage 46 47 USE obs_spm ! spm data storage 48 USE obs_fco2 ! fco2 data storage 47 49 USE obs_types ! Definitions for observation types 48 50 USE mpp_map ! MPP mapping … … 90 92 LOGICAL, PUBLIC :: ln_spm !: Logical switch for spm 91 93 LOGICAL, PUBLIC :: ln_spmfb !: Logical switch for spm from feedback files 94 LOGICAL, PUBLIC :: ln_fco2 !: Logical switch for fco2 95 LOGICAL, PUBLIC :: ln_fco2fb !: Logical switch for fco2 from feedback files 92 96 LOGICAL, PUBLIC :: ln_ssh !: Logical switch for sea surface height 93 97 LOGICAL, PUBLIC :: ln_sss !: Logical switch for sea surface salinity … … 177 181 CHARACTER(len=128) :: spmfiles(MaxNumFiles) 178 182 CHARACTER(len=128) :: spmfbfiles(MaxNumFiles) 183 CHARACTER(len=128) :: fco2files(MaxNumFiles) 184 CHARACTER(len=128) :: fco2fbfiles(MaxNumFiles) 179 185 CHARACTER(LEN=128) :: reysstname 180 186 CHARACTER(LEN=12) :: reysstfmt … … 205 211 & ln_spm, ln_spmfb, & 206 212 & spmfiles, spmfbfiles, & 213 & ln_fco2, ln_fco2fb, & 214 & fco2files, fco2fbfiles, & 207 215 & ln_profb_enatim, ln_ignmis, ln_cl4, & 208 216 & ln_sstbias, sstbias_files … … 230 238 INTEGER :: jnumspm 231 239 INTEGER :: jnumspmfb 240 INTEGER :: jnumfco2 241 INTEGER :: jnumfco2fb 232 242 INTEGER :: ji 233 243 INTEGER :: jset … … 243 253 ln_spm = .FALSE. 244 254 ln_spmfb = .FALSE. 255 ln_fco2 = .FALSE. 256 ln_fco2fb = .FALSE. 245 257 246 258 !Initalise all values in namelist arrays … … 267 279 spmfiles(:) = '' 268 280 spmfbfiles(:) = '' 281 fco2files(:) = '' 282 fco2fbfiles(:) = '' 269 283 sstbias_files(:) = '' 270 284 endailyavtypes(:) = -1 … … 385 399 WHERE (spmfbfiles(:) /= '') lmask(:) = .TRUE. 386 400 jnumspmfb = COUNT(lmask) 401 ENDIF 402 IF (ln_fco2) THEN 403 lmask(:) = .FALSE. 404 WHERE (fco2files(:) /= '') lmask(:) = .TRUE. 405 jnumfco2 = COUNT(lmask) 406 ENDIF 407 IF (ln_fco2fb) THEN 408 lmask(:) = .FALSE. 409 WHERE (fco2fbfiles(:) /= '') lmask(:) = .TRUE. 410 jnumfco2fb = COUNT(lmask) 387 411 ENDIF 388 412 … … 420 444 WRITE(numout,*) ' Logical switch for spm observations ln_spm = ', ln_spm 421 445 WRITE(numout,*) ' Logical switch for feedback spm data ln_spmfb = ', ln_spmfb 446 WRITE(numout,*) ' Logical switch for fco2 observations ln_fco2 = ', ln_fco2 447 WRITE(numout,*) ' Logical switch for feedback fco2 data ln_fco2fb = ', ln_fco2fb 422 448 WRITE(numout,*) ' Global distribtion of observations ln_grid_global = ',ln_grid_global 423 449 WRITE(numout,*) & … … 540 566 WRITE(numout,'(1X,2A)') ' Feedback spm input observation file name spmfbfiles = ', & 541 567 TRIM(spmfbfiles(ji)) 568 END DO 569 ENDIF 570 IF (ln_fco2) THEN 571 DO ji = 1, jnumfco2 572 WRITE(numout,'(1X,2A)') ' fco2 input observation file name fco2files = ', & 573 TRIM(fco2files(ji)) 574 END DO 575 ENDIF 576 IF (ln_fco2fb) THEN 577 DO ji = 1, jnumfco2fb 578 WRITE(numout,'(1X,2A)') ' Feedback fco2 input observation file name fco2fbfiles = ', & 579 TRIM(fco2fbfiles(ji)) 542 580 END DO 543 581 ENDIF … … 577 615 & ( .NOT. ln_ssh ).AND.( .NOT. ln_sst ).AND.( .NOT. ln_sss ).AND. & 578 616 & ( .NOT. ln_seaice ).AND.( .NOT. ln_vel3d ).AND.( .NOT. ln_logchl ).AND. & 579 & ( .NOT. ln_spm ) ) THEN617 & ( .NOT. ln_spm ).AND.( .NOT. ln_fco2 ) ) THEN 580 618 IF(lwp) WRITE(numout,cform_war) 581 619 IF(lwp) WRITE(numout,*) ' key_diaobs is activated but logical flags', & 582 620 & ' ln_t3d, ln_s3d, ln_sla, ln_ssh, ln_sst, ln_sss, ln_seaice, ln_vel3d,', & 583 & ' ln_logchl, ln_spm are all set to .FALSE.'621 & ' ln_logchl, ln_spm, ln_fco2 are all set to .FALSE.' 584 622 nwarn = nwarn + 1 585 623 ENDIF … … 1189 1227 1190 1228 ENDIF 1229 1230 ! - fco2 1231 1232 IF ( ln_fco2 ) THEN 1233 1234 ! Set the number of variables for fco2 to 1 1235 nfco2vars = 1 1236 1237 ! Set the number of extra variables for fco2 to 0 1238 nfco2extr = 0 1239 1240 IF ( ln_fco2fb ) THEN 1241 nfco2sets = jnumfco2fb 1242 ELSE 1243 nfco2sets = 1 1244 ENDIF 1245 1246 ALLOCATE(fco2data(nfco2sets)) 1247 ALLOCATE(fco2datqc(nfco2sets)) 1248 fco2data(:)%nsurf=0 1249 fco2datqc(:)%nsurf=0 1250 1251 nfco2sets = 0 1252 1253 IF ( ln_fco2fb ) THEN ! Feedback file format 1254 1255 DO jset = 1, jnumfco2fb 1256 1257 nfco2sets = nfco2sets + 1 1258 1259 CALL obs_rea_fco2( 0, fco2data(nfco2sets), 1, & 1260 & fco2fbfiles(jset:jset), & 1261 & nfco2vars, nfco2extr, nitend-nit000+2, & 1262 & dobsini, dobsend, ln_ignmis, .FALSE. ) 1263 1264 CALL obs_pre_fco2( fco2data(nfco2sets), fco2datqc(nfco2sets), & 1265 & ln_fco2, ln_nea ) 1266 1267 ENDDO 1268 1269 ELSE ! Original file format 1270 1271 nfco2sets = nfco2sets + 1 1272 1273 CALL obs_rea_fco2( 1, fco2data(nfco2sets), jnumfco2, & 1274 & fco2files(1:jnumfco2), & 1275 & nfco2vars, nfco2extr, nitend-nit000+2, & 1276 & dobsini, dobsend, ln_ignmis, .FALSE. ) 1277 1278 CALL obs_pre_fco2( fco2data(nfco2sets), fco2datqc(nfco2sets), & 1279 & ln_fco2, ln_nea ) 1280 1281 ENDIF 1282 1283 ENDIF 1191 1284 1192 1285 END SUBROUTINE dia_obs_init … … 1208 1301 !! - Sea surface log10(chlorophyll) 1209 1302 !! - Sea surface spm 1303 !! - Sea surface fco2 1210 1304 !! 1211 1305 !! ** Action : … … 1246 1340 #endif 1247 1341 #if defined key_hadocc 1248 USE trc, ONLY : & ! HadOCC chlorophyll 1342 USE trc, ONLY : & ! HadOCC chlorophyll and fCO2 1249 1343 & HADOCC_CHL, & 1344 & HADOCC_FCO2, & 1250 1345 & HADOCC_FILL_FLT 1251 1346 #elif defined key_medusa && defined key_foam_medusa 1252 USE trc, ONLY : & ! MEDUSA chlorophyll 1347 USE trc, ONLY : & ! MEDUSA chlorophyll and fCO2 1253 1348 & MEDUSA_CHL, & 1349 & MEDUSA_FCO2, & 1254 1350 & MEDUSA_FILL_FLT 1255 1351 #elif defined key_fabm 1256 !USE ??? ! ERSEM chlorophyll 1352 !USE ??? ! ERSEM chlorophyll and fCO2 1257 1353 #endif 1258 1354 #if defined key_spm … … 1273 1369 INTEGER :: jlogchlset ! logchl data set loop variable 1274 1370 INTEGER :: jspmset ! spm data set loop variable 1371 INTEGER :: jfco2set ! fco2 data set loop variable 1275 1372 INTEGER :: jvar ! Variable number 1276 1373 #if ! defined key_lim2 && ! defined key_lim3 … … 1284 1381 REAL(wp), DIMENSION(jpi,jpj) :: & 1285 1382 spm ! array for spm 1383 REAL(wp), DIMENSION(jpi,jpj) :: & 1384 fco2 ! array for fco2 1385 REAL(wp), DIMENSION(jpi,jpj) :: & 1386 maskfco2 ! array for special fco2 mask 1286 1387 INTEGER :: jn ! loop index 1287 1388 CHARACTER(LEN=20) :: datestr=" ",timestr=" " … … 1445 1546 ENDIF 1446 1547 1548 IF ( ln_fco2 ) THEN 1549 maskfco2(:,:) = tmask(:,:,1) ! create a special mask to exclude certain things 1550 #if defined key_hadocc 1551 fco2(:,:) = HADOCC_FCO2(:,:) ! fCO2 from HadOCC 1552 IF ( ( MINVAL( HADOCC_FCO2 ) == HADOCC_FILL_FLT ).AND.( MAXVAL( HADOCC_FCO2 ) == HADOCC_FILL_FLT ) ) THEN 1553 fco2(:,:) = obfillflt 1554 maskfco2(:,:) = 0 1555 CALL ctl_warn( ' HadOCC fCO2 values masked out for observation operator', & 1556 & ' on timestep ' // TRIM(STR(kstp)), & 1557 & ' as HADOCC_FCO2(:,:) == HADOCC_FILL_FLT' ) 1558 ENDIF 1559 #elif defined key_medusa && defined key_foam_medusa 1560 fco2(:,:) = MEDUSA_FCO2(:,:) ! fCO2 from MEDUSA 1561 IF ( ( MINVAL( MEDUSA_FCO2 ) == MEDUSA_FILL_FLT ).AND.( MAXVAL( MEDUSA_FCO2 ) == MEDUSA_FILL_FLT ) ) THEN 1562 fco2(:,:) = obfillflt 1563 maskfco2(:,:) = 0 1564 CALL ctl_warn( ' MEDUSA fCO2 values masked out for observation operator', & 1565 & ' on timestep ' // TRIM(STR(kstp)), & 1566 & ' as MEDUSA_FCO2(:,:) == MEDUSA_FILL_FLT' ) 1567 ENDIF 1568 #elif defined key_fabm 1569 !fco2(:,:) = ??? ! fCO2 from ERSEM 1570 CALL ctl_stop( ' Trying to run fco2 observation operator', & 1571 & ' but not properly implemented for FABM-ERSEM yet' ) 1572 #else 1573 CALL ctl_stop( ' Trying to run fco2 observation operator', & 1574 & ' but no biogeochemical model appears to have been defined' ) 1575 #endif 1576 1577 DO jfco2set = 1, nfco2sets 1578 CALL obs_fco2_opt( fco2datqc(jfco2set), & 1579 & kstp, jpi, jpj, nit000, fco2(:,:), & 1580 & maskfco2(:,:), n2dint ) 1581 END DO 1582 ENDIF 1583 1447 1584 #if ! defined key_lim2 && ! defined key_lim3 1448 1585 CALL wrk_dealloc(jpi,jpj,frld) … … 1479 1616 INTEGER :: jlogchlset ! logchl data set loop variable 1480 1617 INTEGER :: jspmset ! spm data set loop variable 1618 INTEGER :: jfco2set ! fco2 data set loop variable 1481 1619 INTEGER :: jset 1482 1620 INTEGER :: jfbini … … 1771 1909 WRITE(cdtmp,'(A,I2.2)')'spmfb_',jspmset 1772 1910 CALL obs_wri_spm( cdtmp, spmdata(jspmset) ) 1911 1912 END DO 1913 1914 ENDIF 1915 1916 ! - fco2 1917 IF ( ln_fco2 ) THEN 1918 1919 ! Copy data from fco2datqc to fco2data structures 1920 DO jfco2set = 1, nfco2sets 1921 1922 CALL obs_surf_decompress( fco2datqc(jfco2set), & 1923 & fco2data(jfco2set), .TRUE., numout ) 1924 1925 END DO 1926 1927 ! Mark as bad observations with no valid model counterpart due to fCO2 not being in the restart 1928 ! Seem to need to set to fill value rather than marking as bad to be effective, so do both 1929 DO jfco2set = 1, nfco2sets 1930 WHERE ( fco2data(jfco2set)%rmod(:,1) == obfillflt ) 1931 fco2data(jfco2set)%nqc(:) = 1 1932 fco2data(jfco2set)%robs(:,1) = obfillflt 1933 END WHERE 1934 END DO 1935 1936 ! Write the fco2 data 1937 DO jfco2set = 1, nfco2sets 1938 1939 WRITE(cdtmp,'(A,I2.2)')'fco2fb_',jfco2set 1940 CALL obs_wri_fco2( cdtmp, fco2data(jfco2set) ) 1773 1941 1774 1942 END DO
Note: See TracChangeset
for help on using the changeset viewer.