Changeset 8856
- Timestamp:
- 2017-11-30T14:06:43+01:00 (7 years ago)
- Location:
- branches/UKMO/dev_r5518_obs_oper_update_obserr/NEMOGCM/NEMO/OPA_SRC/OBS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_r5518_obs_oper_update_obserr/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_surf.F90
r7992 r8856 97 97 INTEGER :: ios 98 98 INTEGER :: ioserrcount 99 INTEGER :: iextr 99 100 INTEGER, PARAMETER :: jpsurfmaxtype = 1024 100 101 INTEGER, DIMENSION(knumfiles) :: irefdate … … 108 109 & iindx, & 109 110 & ifileidx, & 110 & isurfidx 111 & isurfidx, & 112 & iadd_std 111 113 REAL(wp), DIMENSION(:), ALLOCATABLE :: & 112 114 & zphi, & … … 122 124 123 125 ! Local initialization 124 iobs = 0125 126 iobs = 0 127 iextr = kextr 126 128 !----------------------------------------------------------------------- 127 129 ! Count the number of files needed and allocate the obfbdata type … … 131 133 132 134 ALLOCATE( inpfiles(inobf) ) 135 ALLOCATE( iadd_std(inobf) ) 133 136 134 137 surf_files : DO jj = 1, inobf … … 195 198 ENDIF 196 199 END DO 200 ENDIF 201 202 iadd_std(jj) = -1 203 IF ( inpfiles(jj)%nadd > 0 ) THEN 204 DO ji = 1, inpfiles(jj)%nadd 205 IF ( TRIM( inpfiles(jj)%caddname(ji) ) == 'STD' ) THEN 206 iextr = kextr + 1 207 iadd_std(jj) = ji 208 ENDIF 209 END DO 210 ENDIF 211 212 IF(lwp) THEN 213 IF ( iadd_std(jj) /= -1 ) THEN 214 WRITE(numout,*) ' STD variable available in input file so passing it through the obs oper' 215 WRITE(numout,*) 216 ENDIF 197 217 ENDIF 198 218 … … 339 359 & iindx ) 340 360 341 CALL obs_surf_alloc( surfdata, iobs, kvars, kextr, kstp, jpi, jpj )361 CALL obs_surf_alloc( surfdata, iobs, kvars, iextr, kstp, jpi, jpj ) 342 362 343 363 ! Read obs/positions, QC, all variable and assign to surfdata … … 345 365 iobs = 0 346 366 surfdata%cvars(:) = clvars(:) 367 IF ( ldmod .AND. ( TRIM( surfdata%cvars(1) ) == 'SLA' ) ) THEN 368 surfdata%cext(1) = 'SSH' 369 surfdata%cext(2) = 'MDT' 370 ENDIF 371 IF ( iextra > kextr ) surfdata%cext(iextr) = 'STD' 347 372 348 373 ityp (:) = 0 … … 426 451 surfdata%robs(iobs,1) = inpfiles(jj)%pob(1,ji,1) 427 452 428 429 453 ! Model and MDT is set to fbrmdi unless read from file 430 454 IF ( ldmod ) THEN … … 437 461 surfdata%rmod(iobs,1) = fbrmdi 438 462 IF ( TRIM(surfdata%cvars(1)) == 'SLA' ) surfdata%rext(iobs,:) = fbrmdi 463 ENDIF 464 465 ! STD (obs error standard deviation) read from file and passed through obs operator 466 IF ( iadd_std(jj) /= -1 ) THEN 467 surfdata%rext(iobs,iextr) = inpfiles(jj)%padd(1,ji,iadd_std(jj),1) 439 468 ENDIF 440 469 ENDIF … … 488 517 END DO 489 518 DEALLOCATE( inpfiles ) 519 DEALLOCATE( iadd_std ) 490 520 491 521 END SUBROUTINE obs_rea_surf -
branches/UKMO/dev_r5518_obs_oper_update_obserr/NEMOGCM/NEMO/OPA_SRC/OBS/obs_surf_def.F90
r7992 r8856 71 71 CHARACTER(len=8), POINTER, DIMENSION(:) :: & 72 72 & cvars !: Variable names 73 74 CHARACTER(len=8), POINTER, DIMENSION(:) :: & 75 & cext !: Extra field names 73 76 74 77 CHARACTER(LEN=8), POINTER, DIMENSION(:) :: & … … 200 203 201 204 ALLOCATE( & 202 & surf%rext(ksurf,kextra) & 205 & surf%rext(ksurf,kextra), & 206 & surf%cext(kextra) & 203 207 & ) 204 208 205 209 surf%rext(:,:) = 0.0_wp 210 211 DO ji = 1, kextra 212 surf%cext(ji) = "NotSet" 213 END DO 206 214 207 215 ! Allocate arrays of number of time step size … … 288 296 289 297 DEALLOCATE( & 290 & surf%rext & 298 & surf%rext, & 299 & cext & 291 300 & ) 292 301 … … 435 444 newsurf%nstp = surf%nstp 436 445 newsurf%cvars(:) = surf%cvars(:) 446 newsurf%cext(:) = surf%cext(:) 437 447 438 448 ! Set gridded stuff -
branches/UKMO/dev_r5518_obs_oper_update_obserr/NEMOGCM/NEMO/OPA_SRC/OBS/obs_write.F90
r8223 r8856 327 327 INTEGER :: iadd 328 328 INTEGER :: iext 329 INTEGER :: indx_std 330 INTEGER :: iadd_std 329 331 330 332 IF ( PRESENT( padd ) ) THEN … … 340 342 ENDIF 341 343 344 IF ( surfdata%nextra > 0 ) THEN 345 346 indx_std = -1 347 iadd_std = 0 348 DO je = 1, surfdata%nextra 349 IF ( TRIM( surfdata%cext(je) ) == 'STD' ) THEN 350 iadd_std = 1 351 indx_std = je 352 ENDIF 353 END DO 354 342 355 CALL init_obfbdata( fbdata ) 343 356 … … 346 359 347 360 CALL alloc_obfbdata( fbdata, 1, surfdata%nsurf, 1, & 348 & 2 + iadd , 1 + iext, .TRUE. )361 & 2 + iadd + iadd_std, 1 + iext, .TRUE. ) 349 362 350 363 clfiletype = 'slafb' … … 367 380 fbdata%cgrid(1) = 'T' 368 381 DO ja = 1, iadd 369 fbdata%caddname(2+ ja) = padd%cdname(ja)370 fbdata%caddlong(2+ ja,1) = padd%cdlong(ja,1)371 fbdata%caddunit(2+ ja,1) = padd%cdunit(ja,1)382 fbdata%caddname(2+iadd_std+ja) = padd%cdname(ja) 383 fbdata%caddlong(2+iadd_std+ja,1) = padd%cdlong(ja,1) 384 fbdata%caddunit(2+iadd_std+ja,1) = padd%cdunit(ja,1) 372 385 END DO 373 386 … … 375 388 376 389 CALL alloc_obfbdata( fbdata, 1, surfdata%nsurf, 1, & 377 & 1 + iadd , iext, .TRUE. )390 & 1 + iadd + iadd_std, iext, .TRUE. ) 378 391 379 392 clfiletype = 'sstfb' … … 390 403 fbdata%cgrid(1) = 'T' 391 404 DO ja = 1, iadd 392 fbdata%caddname(1+ ja) = padd%cdname(ja)393 fbdata%caddlong(1+ ja,1) = padd%cdlong(ja,1)394 fbdata%caddunit(1+ ja,1) = padd%cdunit(ja,1)405 fbdata%caddname(1+iadd_std+ja) = padd%cdname(ja) 406 fbdata%caddlong(1+iadd_std+ja,1) = padd%cdlong(ja,1) 407 fbdata%caddunit(1+iadd_std+ja,1) = padd%cdunit(ja,1) 395 408 END DO 396 409 … … 398 411 399 412 CALL alloc_obfbdata( fbdata, 1, surfdata%nsurf, 1, & 400 & 1 + iadd , iext, .TRUE. )413 & 1 + iadd + iadd_std, iext, .TRUE. ) 401 414 402 415 clfiletype = 'sicfb' … … 413 426 fbdata%cgrid(1) = 'T' 414 427 DO ja = 1, iadd 415 fbdata%caddname(1+ ja) = padd%cdname(ja)416 fbdata%caddlong(1+ ja,1) = padd%cdlong(ja,1)417 fbdata%caddunit(1+ ja,1) = padd%cdunit(ja,1)428 fbdata%caddname(1+iadd_std+ja) = padd%cdname(ja) 429 fbdata%caddlong(1+iadd_std+ja,1) = padd%cdlong(ja,1) 430 fbdata%caddunit(1+iadd_std+ja,1) = padd%cdunit(ja,1) 418 431 END DO 419 432 … … 421 434 422 435 CALL alloc_obfbdata( fbdata, 1, surfdata%nsurf, 1, & 423 & 1 + iadd , iext, .TRUE. )436 & 1 + iadd + iadd_std, iext, .TRUE. ) 424 437 425 438 clfiletype = 'sssfb' … … 436 449 fbdata%cgrid(1) = 'T' 437 450 DO ja = 1, iadd 438 fbdata%caddname(1+ ja) = padd%cdname(ja)439 fbdata%caddlong(1+ ja,1) = padd%cdlong(ja,1)440 fbdata%caddunit(1+ ja,1) = padd%cdunit(ja,1)451 fbdata%caddname(1+iadd_std+ja) = padd%cdname(ja) 452 fbdata%caddlong(1+iadd_std+ja,1) = padd%cdlong(ja,1) 453 fbdata%caddunit(1+iadd_std+ja,1) = padd%cdunit(ja,1) 441 454 END DO 442 455 … … 444 457 445 458 CALL alloc_obfbdata( fbdata, 1, surfdata%nsurf, 1, & 446 & 1 + iadd , iext, .TRUE. )459 & 1 + iadd + iadd_std, iext, .TRUE. ) 447 460 448 461 clfiletype = 'logchlfb' … … 459 472 fbdata%cgrid(1) = 'T' 460 473 DO ja = 1, iadd 461 fbdata%caddname(1+ ja) = padd%cdname(ja)462 fbdata%caddlong(1+ ja,1) = padd%cdlong(ja,1)463 fbdata%caddunit(1+ ja,1) = padd%cdunit(ja,1)474 fbdata%caddname(1+iadd_std+ja) = padd%cdname(ja) 475 fbdata%caddlong(1+iadd_std+ja,1) = padd%cdlong(ja,1) 476 fbdata%caddunit(1+iadd_std+ja,1) = padd%cdunit(ja,1) 464 477 END DO 465 478 … … 467 480 468 481 CALL alloc_obfbdata( fbdata, 1, surfdata%nsurf, 1, & 469 & 1 + iadd , iext, .TRUE. )482 & 1 + iadd + iadd_std, iext, .TRUE. ) 470 483 471 484 clfiletype = 'spmfb' … … 482 495 fbdata%cgrid(1) = 'T' 483 496 DO ja = 1, iadd 484 fbdata%caddname(1+ ja) = padd%cdname(ja)485 fbdata%caddlong(1+ ja,1) = padd%cdlong(ja,1)486 fbdata%caddunit(1+ ja,1) = padd%cdunit(ja,1)497 fbdata%caddname(1+iadd_std+ja) = padd%cdname(ja) 498 fbdata%caddlong(1+iadd_std+ja,1) = padd%cdlong(ja,1) 499 fbdata%caddunit(1+iadd_std+ja,1) = padd%cdunit(ja,1) 487 500 END DO 488 501 … … 490 503 491 504 CALL alloc_obfbdata( fbdata, 1, surfdata%nsurf, 1, & 492 & 1 + iadd , iext, .TRUE. )505 & 1 + iadd + iadd_std, iext, .TRUE. ) 493 506 494 507 clfiletype = 'fco2fb' … … 505 518 fbdata%cgrid(1) = 'T' 506 519 DO ja = 1, iadd 507 fbdata%caddname(1+ ja) = padd%cdname(ja)508 fbdata%caddlong(1+ ja,1) = padd%cdlong(ja,1)509 fbdata%caddunit(1+ ja,1) = padd%cdunit(ja,1)520 fbdata%caddname(1+iadd_std+ja) = padd%cdname(ja) 521 fbdata%caddlong(1+iadd_std+ja,1) = padd%cdlong(ja,1) 522 fbdata%caddunit(1+iadd_std+ja,1) = padd%cdunit(ja,1) 510 523 END DO 511 524 … … 513 526 514 527 CALL alloc_obfbdata( fbdata, 1, surfdata%nsurf, 1, & 515 & 1 + iadd , iext, .TRUE. )528 & 1 + iadd + iadd_std, iext, .TRUE. ) 516 529 517 530 clfiletype = 'pco2fb' … … 528 541 fbdata%cgrid(1) = 'T' 529 542 DO ja = 1, iadd 530 fbdata%caddname(1+ ja) = padd%cdname(ja)531 fbdata%caddlong(1+ ja,1) = padd%cdlong(ja,1)532 fbdata%caddunit(1+ ja,1) = padd%cdunit(ja,1)543 fbdata%caddname(1+iadd_std+ja) = padd%cdname(ja) 544 fbdata%caddlong(1+iadd_std+ja,1) = padd%cdlong(ja,1) 545 fbdata%caddunit(1+iadd_std+ja,1) = padd%cdunit(ja,1) 533 546 END DO 534 547 … … 540 553 541 554 fbdata%caddname(1) = 'Hx' 555 IF ( indx_std /= -1 ) THEN 556 IF ( TRIM(surfdata%cvars(1)) == 'SLA' ) iadd_std = iadd_std + 1 557 fbdata%caddname(1+iadd_std) = surfdata%cext(indx_std) 558 fbdata%caddlong(1+iadd_std,1) = 'Obs error standard deviation' 559 fbdata%caddunit(1+iadd_std,1) = fbdata%cobunit(1) 560 ENDIF 542 561 543 562 WRITE(clfname, FMT="(A,'_fdbk_',I4.4,'.nc')") TRIM(clfiletype), nproc … … 605 624 fbdata%iobsk(1,jo,1) = 0 606 625 IF ( TRIM(surfdata%cvars(1)) == 'SLA' ) fbdata%pext(1,jo,1) = surfdata%rext(jo,2) 607 DO ja = 1, iadd 608 fbdata%padd(1,jo,2+ja,1) = & 626 IF ( indx_std /= -1 ) THEN 627 fbdata%padd(1,jo,1+iadd_std,1) = surfdata%rext(jo,indx_std) 628 ENDIF 629 630 DO ja = 1, iadd 631 fbdata%padd(1,jo,2+iadd_std+ja,1) = & 609 632 & surfdata%rext(jo,padd%ipoint(ja)) 610 633 END DO
Note: See TracChangeset
for help on using the changeset viewer.