- Timestamp:
- 2020-03-26T11:57:02+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_r5518_obs_oper_update/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90
r9486 r12610 21 21 !! dyn_asm_inc : Apply the dynamic (u and v) increments 22 22 !! ssh_asm_inc : Apply the SSH increment 23 !! seaice_asm_inc : Apply the seaice increment 23 !! seaice_asm_inc : Apply the sea ice concentration increment 24 !! sit_asm_inc : Apply the sea ice thickness increment 24 25 !!---------------------------------------------------------------------- 25 26 USE wrk_nemo ! Memory Allocation … … 49 50 PUBLIC dyn_asm_inc !: Apply the dynamic (u and v) increments 50 51 PUBLIC ssh_asm_inc !: Apply the SSH increment 51 PUBLIC seaice_asm_inc !: Apply the seaice increment 52 PUBLIC seaice_asm_inc !: Apply the seaice concentration increment 53 PUBLIC sit_asm_inc !: Apply the seaice thickness increment 54 PUBLIC bgc_asm_inc !: Apply the biogeochemistry increments 52 55 53 56 #if defined key_asminc … … 57 60 #endif 58 61 LOGICAL, PUBLIC :: ln_bkgwri = .FALSE. !: No output of the background state fields 62 LOGICAL, PUBLIC :: ln_avgbkg = .FALSE. !: No output of the mean background state fields 59 63 LOGICAL, PUBLIC :: ln_asmiau = .FALSE. !: No applying forcing with an assimilation increment 60 64 LOGICAL, PUBLIC :: ln_asmdin = .FALSE. !: No direct initialization … … 62 66 LOGICAL, PUBLIC :: ln_dyninc = .FALSE. !: No dynamics (u and v) assimilation increments 63 67 LOGICAL, PUBLIC :: ln_sshinc = .FALSE. !: No sea surface height assimilation increment 64 LOGICAL, PUBLIC :: ln_seaiceinc !: No sea ice concentration increment 68 LOGICAL, PUBLIC :: ln_seaiceinc = .FALSE. !: No sea ice concentration increment 69 LOGICAL, PUBLIC :: ln_sitinc = .FALSE. !: No sea ice thickness increment 70 LOGICAL, PUBLIC :: lk_bgcinc = .FALSE. !: No biogeochemistry increments 65 71 LOGICAL, PUBLIC :: ln_salfix = .FALSE. !: Apply minimum salinity check 66 72 LOGICAL, PUBLIC :: ln_temnofreeze = .FALSE. !: Don't allow the temperature to drop below freezing … … 85 91 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ssh_bkg, ssh_bkginc ! Background sea surface height and its increment 86 92 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: seaice_bkginc ! Increment to the background sea ice conc 93 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: sit_bkginc ! Increment to the background sea ice thickness 87 94 88 95 !! * Substitutions … … 127 134 REAL(wp), POINTER, DIMENSION(:,:) :: hdiv ! 2D workspace 128 135 !! 129 NAMELIST/nam_asminc/ ln_bkgwri, 136 NAMELIST/nam_asminc/ ln_bkgwri, ln_avgbkg, ln_balwri, & 130 137 & ln_trainc, ln_dyninc, ln_sshinc, & 131 138 & ln_asmdin, ln_asmiau, & … … 138 145 !----------------------------------------------------------------------- 139 146 ln_seaiceinc = .FALSE. 147 ln_sitinc = .FALSE. 140 148 ln_temnofreeze = .FALSE. 141 149 … … 154 162 WRITE(numout,*) 'asm_inc_init : Assimilation increment initialization :' 155 163 WRITE(numout,*) '~~~~~~~~~~~~' 156 WRITE(numout,*) ' Namelist nam asm: set assimilation increment parameters'164 WRITE(numout,*) ' Namelist nam_asminc : set assimilation increment parameters' 157 165 WRITE(numout,*) ' Logical switch for writing out background state ln_bkgwri = ', ln_bkgwri 166 WRITE(numout,*) ' Logical switch for writing mean background state ln_avgbkg = ', ln_avgbkg 167 WRITE(numout,*) ' Logical switch for writing out balancing increments ln_balwri = ', ln_balwri 158 168 WRITE(numout,*) ' Logical switch for applying tracer increments ln_trainc = ', ln_trainc 159 169 WRITE(numout,*) ' Logical switch for applying velocity increments ln_dyninc = ', ln_dyninc 160 170 WRITE(numout,*) ' Logical switch for applying SSH increments ln_sshinc = ', ln_sshinc 171 WRITE(numout,*) ' Logical switch for applying SIC increments ln_seaiceinc = ', ln_seaiceinc 172 WRITE(numout,*) ' Logical switch for applying SIT increments ln_sitinc = ', ln_sitinc 161 173 WRITE(numout,*) ' Logical switch for Direct Initialization (DI) ln_asmdin = ', ln_asmdin 162 WRITE(numout,*) ' Logical switch for applying sea ice increments ln_seaiceinc = ', ln_seaiceinc163 174 WRITE(numout,*) ' Logical switch for Incremental Analysis Updating (IAU) ln_asmiau = ', ln_asmiau 164 175 WRITE(numout,*) ' Timestep of background in [0,nitend-nit000-1] nitbkg = ', nitbkg … … 216 227 217 228 IF ( ( ( .NOT. ln_asmdin ).AND.( .NOT. ln_asmiau ) ) & 218 .AND.( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ) .OR. ( ln_seaiceinc) )) & 219 & CALL ctl_stop( ' One or more of ln_trainc, ln_dyninc, ln_sshinc and ln_seaiceinc is set to .true.', & 229 & .AND.( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ).OR. & 230 & ( ln_sitinc ).OR.( lk_bgcinc ) )) & 231 & CALL ctl_stop( ' One or more of ln_trainc, ln_dyninc, ln_sshinc, ln_seaiceinc,', & 232 & ' ln_sitinc and ln_(bgc-variable)inc is set to .true.', & 220 233 & ' but ln_asmdin and ln_asmiau are both set to .false. :', & 221 234 & ' Inconsistent options') … … 226 239 227 240 IF ( ( .NOT. ln_trainc ).AND.( .NOT. ln_dyninc ).AND.( .NOT. ln_sshinc ).AND.( .NOT. ln_seaiceinc ) & 228 & ) & 229 & CALL ctl_warn( ' ln_trainc, ln_dyninc, ln_sshinc and ln_seaiceinc are set to .false. :', & 241 & .AND.( .NOT. ln_sitinc ).AND.( .NOT. lk_bgcinc ) ) & 242 & CALL ctl_warn( ' ln_trainc, ln_dyninc, ln_sshinc, ln_seaiceinc,', & 243 & ' ln_sitinc and ln_(bgc-variable)inc are set to .false. :', & 230 244 & ' The assimilation increments are not applied') 231 245 … … 325 339 !-------------------------------------------------------------------- 326 340 327 ALLOCATE( t_bkginc(jpi,jpj,jpk) ) 328 ALLOCATE( s_bkginc(jpi,jpj,jpk) ) 329 ALLOCATE( u_bkginc(jpi,jpj,jpk) ) 330 ALLOCATE( v_bkginc(jpi,jpj,jpk) ) 331 ALLOCATE( ssh_bkginc(jpi,jpj) ) 332 ALLOCATE( seaice_bkginc(jpi,jpj)) 341 IF ( ln_trainc ) THEN 342 ALLOCATE( t_bkginc(jpi,jpj,jpk) ) 343 ALLOCATE( s_bkginc(jpi,jpj,jpk) ) 344 t_bkginc(:,:,:) = 0.0 345 s_bkginc(:,:,:) = 0.0 346 ENDIF 347 IF ( ln_dyninc ) THEN 348 ALLOCATE( u_bkginc(jpi,jpj,jpk) ) 349 ALLOCATE( v_bkginc(jpi,jpj,jpk) ) 350 u_bkginc(:,:,:) = 0.0 351 v_bkginc(:,:,:) = 0.0 352 ENDIF 353 IF ( ln_sshinc ) THEN 354 ALLOCATE( ssh_bkginc(jpi,jpj) ) 355 ssh_bkginc(:,:) = 0.0 356 ENDIF 357 IF ( ln_seaiceinc ) THEN 358 ALLOCATE( seaice_bkginc(jpi,jpj)) 359 seaice_bkginc(:,:) = 0.0 360 ENDIF 361 IF ( ln_sitinc ) THEN 362 ALLOCATE( sit_bkginc(jpi,jpj)) 363 sit_bkginc(:,:) = 0.0 364 ENDIF 333 365 #if defined key_asminc 334 366 ALLOCATE( ssh_iau(jpi,jpj) ) 335 #endif336 t_bkginc(:,:,:) = 0.0337 s_bkginc(:,:,:) = 0.0338 u_bkginc(:,:,:) = 0.0339 v_bkginc(:,:,:) = 0.0340 ssh_bkginc(:,:) = 0.0341 seaice_bkginc(:,:) = 0.0342 #if defined key_asminc343 367 ssh_iau(:,:) = 0.0 344 368 #endif 345 IF ( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ) ) THEN 369 IF ( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ) & 370 & .OR.( ln_sitinc ).OR.( lk_bgcinc ) ) THEN 346 371 347 372 !-------------------------------------------------------------------- … … 406 431 ! to allow for differences in masks 407 432 WHERE( ABS( ssh_bkginc(:,:) ) > 1.0e+10 ) ssh_bkginc(:,:) = 0.0 433 ENDIF 434 435 IF ( ln_sitinc ) THEN 436 CALL iom_get( inum, jpdom_autoglo, 'bckinsit', sit_bkginc, 1 ) 437 ! Apply the masks 438 sit_bkginc(:,:) = sit_bkginc(:,:) * tmask(:,:,1) 439 ! Set missing increments to 0.0 rather than 1e+20 440 ! to allow for differences in masks 441 WHERE( ABS( sit_bkginc(:,:) ) > 1.0e+10 ) sit_bkginc(:,:) = 0.0 408 442 ENDIF 409 443 … … 766 800 ! Perhaps the following call should be in step 767 801 IF ( ln_seaiceinc ) CALL seaice_asm_inc ( kt ) ! apply sea ice concentration increment 802 IF ( ln_sitinc ) CALL sit_asm_inc ( kt ) ! apply sea ice thickness increment 768 803 ! 769 804 END SUBROUTINE tra_asm_inc … … 923 958 END SUBROUTINE ssh_asm_inc 924 959 960 SUBROUTINE sit_asm_inc( kt, kindic ) 961 !!---------------------------------------------------------------------- 962 !! *** ROUTINE sit_asm_inc *** 963 !! 964 !! ** Purpose : Apply the sea ice thickness assimilation increment. 965 !! 966 !! ** Method : Direct initialization or Incremental Analysis Updating. 967 !! 968 !! ** Action : 969 !! 970 !!---------------------------------------------------------------------- 971 IMPLICIT NONE 972 ! 973 INTEGER, INTENT(in) :: kt ! Current time step 974 INTEGER, INTENT(in), OPTIONAL :: kindic ! flag for disabling the deallocation 975 ! 976 INTEGER :: it 977 REAL(wp) :: zincwgt ! IAU weight for current time step 978 !!---------------------------------------------------------------------- 979 980 IF ( ln_asmiau ) THEN 981 982 !-------------------------------------------------------------------- 983 ! Incremental Analysis Updating 984 !-------------------------------------------------------------------- 985 986 IF ( ( kt >= nitiaustr_r ).AND.( kt <= nitiaufin_r ) ) THEN 987 988 it = kt - nit000 + 1 989 zincwgt = wgtiau(it) ! IAU weight for the current time step 990 ! note this is not a tendency so should not be divided by rdt (as with the tracer and other increments) 991 ! EF: Actually CICE is expecting a tendency so is divided by rdt below 992 993 IF(lwp) THEN 994 WRITE(numout,*) 995 WRITE(numout,*) 'sit_asm_inc : sea ice thick IAU at time step = ', & 996 & kt,' with IAU weight = ', wgtiau(it) 997 WRITE(numout,*) '~~~~~~~~~~~~' 998 ENDIF 999 1000 #if defined key_cice && defined key_asminc 1001 ! Sea-ice thickness : CICE case. Pass ice thickness increment tendency into CICE 1002 ndsit_da(:,:) = sit_bkginc(:,:) * zincwgt / rdt 1003 #endif 1004 1005 IF ( kt == nitiaufin_r ) THEN 1006 DEALLOCATE( sit_bkginc ) 1007 ENDIF 1008 1009 ELSE 1010 1011 #if defined key_cice && defined key_asminc 1012 ! Sea-ice thickness : CICE case. Zero ice increment tendency into CICE 1013 ndsit_da(:,:) = 0.0_wp 1014 #endif 1015 1016 ENDIF 1017 1018 ELSEIF ( ln_asmdin ) THEN 1019 1020 !-------------------------------------------------------------------- 1021 ! Direct Initialization 1022 !-------------------------------------------------------------------- 1023 1024 IF ( kt == nitdin_r ) THEN 1025 1026 neuler = 0 ! Force Euler forward step 1027 1028 #if defined key_cice && defined key_asminc 1029 ! Sea-ice thickness : CICE case. Pass ice thickness increment tendency into CICE 1030 ndsit_da(:,:) = sit_bkginc(:,:) / rdt 1031 #endif 1032 IF ( .NOT. PRESENT(kindic) ) THEN 1033 DEALLOCATE( sit_bkginc ) 1034 END IF 1035 1036 ELSE 1037 1038 #if defined key_cice && defined key_asminc 1039 ! Sea-ice thicnkness : CICE case. Zero ice thickness increment tendency into CICE 1040 ndsit_da(:,:) = 0.0_wp 1041 #endif 1042 1043 ENDIF 1044 1045 ENDIF 1046 1047 END SUBROUTINE sit_asm_inc 925 1048 926 1049 SUBROUTINE seaice_asm_inc( kt, kindic ) … … 928 1051 !! *** ROUTINE seaice_asm_inc *** 929 1052 !! 930 !! ** Purpose : Apply the sea ice assimilation increment.1053 !! ** Purpose : Apply the sea ice concentration assimilation increment. 931 1054 !! 932 1055 !! ** Method : Direct initialization or Incremental Analysis Updating.
Note: See TracChangeset
for help on using the changeset viewer.