New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 6736 for branches/NERC/dev_r3874_FASTNEt/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90 – NEMO

Ignore:
Timestamp:
2016-06-24T09:50:27+02:00 (8 years ago)
Author:
jamesharle
Message:

FASTNEt code modifications

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r3874_FASTNEt/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90

    r3785 r6736  
    1414 
    1515   !!---------------------------------------------------------------------- 
    16    !!   'key_asminc'   : Switch on the assimilation increment interface 
     16   !!   'key_asminc' : Switch on the assimilation increment interface 
    1717   !!---------------------------------------------------------------------- 
    18    !!   asm_inc_init   : Initialize the increment arrays and IAU weights 
    19    !!   calc_date      : Compute the calendar date YYYYMMDD on a given step 
    20    !!   tra_asm_inc    : Apply the tracer (T and S) increments 
    21    !!   dyn_asm_inc    : Apply the dynamic (u and v) increments 
    22    !!   ssh_asm_inc    : Apply the SSH increment 
    23    !!   seaice_asm_inc : Apply the seaice increment 
     18   !!   asm_inc_init : Initialize the increment arrays and IAU weights 
     19   !!   calc_date    : Compute the calendar date YYYYMMDD on a given step 
     20   !!   tra_asm_inc  : Apply the tracer (T and S) increments 
     21   !!   dyn_asm_inc  : Apply the dynamic (u and v) increments 
     22   !!   ssh_asm_inc  : Apply the SSH increment 
     23   !!   seaice_asm_inc  : Apply the seaice increment 
    2424   !!---------------------------------------------------------------------- 
    2525   USE wrk_nemo         ! Memory Allocation 
    2626   USE par_oce          ! Ocean space and time domain variables 
    2727   USE dom_oce          ! Ocean space and time domain 
    28    USE domvvl           ! domain: variable volume level 
    2928   USE oce              ! Dynamics and active tracers defined in memory 
    3029   USE ldfdyn_oce       ! ocean dynamics: lateral physics 
     
    4039#endif 
    4140   USE sbc_oce          ! Surface boundary condition variables. 
     41   USE domvvl 
    4242 
    4343   IMPLICIT NONE 
     
    9292#  include "ldfdyn_substitute.h90" 
    9393#  include "vectopt_loop_substitute.h90" 
     94 
    9495   !!---------------------------------------------------------------------- 
    9596   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     
    109110      !! ** Action  :  
    110111      !!---------------------------------------------------------------------- 
    111       INTEGER :: ji, jj, jk 
     112      !! 
     113      !! 
     114      INTEGER :: ji,jj,jk 
    112115      INTEGER :: jt 
    113116      INTEGER :: imid 
     
    939942            ! Update before fields 
    940943            sshb(:,:) = sshn(:,:)          
    941  
     944#if ! defined key_jth_fix 
    942945            IF( lk_vvl ) THEN 
    943946               DO jk = 1, jpk 
     
    945948               END DO 
    946949            ENDIF 
    947  
     950#endif 
    948951            DEALLOCATE( ssh_bkg    ) 
    949952            DEALLOCATE( ssh_bkginc ) 
     
    955958   END SUBROUTINE ssh_asm_inc 
    956959 
    957  
    958960   SUBROUTINE seaice_asm_inc( kt, kindic ) 
    959961      !!---------------------------------------------------------------------- 
     
    966968      !! ** Action  :  
    967969      !! 
    968       !!---------------------------------------------------------------------- 
     970      !! History : 
     971      !!        !  07-2011  (D. Lea)  Initial version based on ssh_asm_inc 
     972      !!---------------------------------------------------------------------- 
     973 
    969974      IMPLICIT NONE 
    970       ! 
    971       INTEGER, INTENT(in)           ::   kt   ! Current time step 
    972       INTEGER, INTENT(in), OPTIONAL ::   kindic   ! flag for disabling the deallocation 
    973       ! 
    974       INTEGER  ::   it 
    975       REAL(wp) ::   zincwgt   ! IAU weight for current time step 
     975 
     976      !! * Arguments 
     977      INTEGER, INTENT(IN) :: kt   ! Current time step 
     978      INTEGER, OPTIONAL, INTENT(IN) :: kindic ! flag for disabling the deallocation 
     979 
     980      !! * Local declarations 
     981      INTEGER :: it 
     982      REAL(wp) :: zincwgt  ! IAU weight for current time step 
     983 
    976984#if defined key_lim2 
    977       REAL(wp), DIMENSION(jpi,jpj) ::   zofrld, zohicif, zseaicendg, zhicifinc  ! LIM 
    978       REAL(wp) ::   zhicifmin = 0.5_wp      ! ice minimum depth in metres 
    979 #endif 
    980       !!---------------------------------------------------------------------- 
     985      REAL(wp), DIMENSION(jpi,jpj) :: zofrld, zohicif, zseaicendg, zhicifinc  ! LIM 
     986      REAL(wp) :: zhicifmin=0.5_wp      ! ice minimum depth in metres 
     987 
     988#endif 
     989 
    981990 
    982991      IF ( ln_asmiau ) THEN 
     
    9991008            ENDIF 
    10001009 
    1001             ! Sea-ice : LIM-3 case (to add) 
    1002  
    10031010#if defined key_lim2 
    1004             ! Sea-ice : LIM-2 case 
    1005             zofrld (:,:) = frld(:,:) 
    1006             zohicif(:,:) = hicif(:,:) 
    1007             ! 
    1008             frld  = MIN( MAX( frld (:,:) - seaice_bkginc(:,:) * zincwgt, 0.0_wp), 1.0_wp) 
     1011 
     1012            zofrld(:,:)=frld(:,:) 
     1013            zohicif(:,:)=hicif(:,:) 
     1014 
     1015            frld = MIN( MAX( frld(:,:) - seaice_bkginc(:,:) * zincwgt, 0.0_wp), 1.0_wp) 
    10091016            pfrld = MIN( MAX( pfrld(:,:) - seaice_bkginc(:,:) * zincwgt, 0.0_wp), 1.0_wp) 
    10101017            fr_i(:,:) = 1.0_wp - frld(:,:)        ! adjust ice fraction 
    1011             ! 
    1012             zseaicendg(:,:) = zofrld(:,:) - frld(:,:)   ! find out actual sea ice nudge applied 
    1013             ! 
     1018 
     1019            zseaicendg(:,:)=zofrld(:,:) - frld(:,:)         ! find out actual sea ice nudge applied 
     1020 
    10141021            ! Nudge sea ice depth to bring it up to a required minimum depth 
     1022 
    10151023            WHERE( zseaicendg(:,:) > 0.0_wp .AND. hicif(:,:) < zhicifmin )  
    10161024               zhicifinc(:,:) = (zhicifmin - hicif(:,:)) * zincwgt     
     
    10181026               zhicifinc(:,:) = 0.0_wp 
    10191027            END WHERE 
    1020             ! 
    1021             ! nudge ice depth 
    1022             hicif (:,:) = hicif (:,:) + zhicifinc(:,:) 
    1023             phicif(:,:) = phicif(:,:) + zhicifinc(:,:)        
    1024             ! 
    1025             ! seaice salinity balancing (to add) 
     1028 
     1029! nudge ice depth 
     1030            hicif(:,:)=hicif(:,:) + zhicifinc(:,:) 
     1031            phicif(:,:)=phicif(:,:) + zhicifinc(:,:)        
     1032 
     1033! seaice salinity balancing (to add) 
     1034 
    10261035#endif 
    10271036 
    10281037#if defined key_cice 
    1029             ! Sea-ice : CICE case. Pass ice increment tendency into CICE 
     1038 
     1039! Pass ice increment tendency into CICE 
    10301040            ndaice_da(:,:) = seaice_bkginc(:,:) * zincwgt / rdt 
     1041 
    10311042#endif 
    10321043 
     
    10381049 
    10391050#if defined key_cice 
    1040             ! Sea-ice : CICE case. Zero ice increment tendency into CICE 
     1051 
     1052! Zero ice increment tendency into CICE 
    10411053            ndaice_da(:,:) = 0.0_wp 
     1054 
    10421055#endif 
    10431056 
     
    10541067            neuler = 0                    ! Force Euler forward step 
    10551068 
    1056             ! Sea-ice : LIM-3 case (to add) 
    1057  
    10581069#if defined key_lim2 
    1059             ! Sea-ice : LIM-2 case. 
     1070 
    10601071            zofrld(:,:)=frld(:,:) 
    10611072            zohicif(:,:)=hicif(:,:) 
    1062             !  
     1073  
    10631074            ! Initialize the now fields the background + increment 
    1064             frld (:,:) = MIN( MAX( frld(:,:) - seaice_bkginc(:,:), 0.0_wp), 1.0_wp) 
     1075 
     1076            frld(:,:) = MIN( MAX( frld(:,:) - seaice_bkginc(:,:), 0.0_wp), 1.0_wp) 
    10651077            pfrld(:,:) = frld(:,:)  
    1066             fr_i (:,:) = 1.0_wp - frld(:,:)                ! adjust ice fraction 
    1067             zseaicendg(:,:) = zofrld(:,:) - frld(:,:)      ! find out actual sea ice nudge applied 
    1068             ! 
     1078            fr_i(:,:) = 1.0_wp - frld(:,:)        ! adjust ice fraction 
     1079 
     1080            zseaicendg(:,:)=zofrld(:,:) - frld(:,:)         ! find out actual sea ice nudge applied 
     1081 
    10691082            ! Nudge sea ice depth to bring it up to a required minimum depth 
     1083 
    10701084            WHERE( zseaicendg(:,:) > 0.0_wp .AND. hicif(:,:) < zhicifmin )  
    10711085               zhicifinc(:,:) = (zhicifmin - hicif(:,:)) * zincwgt     
     
    10731087               zhicifinc(:,:) = 0.0_wp 
    10741088            END WHERE 
    1075             ! 
    1076             ! nudge ice depth 
    1077             hicif (:,:) = hicif (:,:) + zhicifinc(:,:) 
    1078             phicif(:,:) = phicif(:,:)        
    1079             ! 
    1080             ! seaice salinity balancing (to add) 
     1089 
     1090! nudge ice depth 
     1091            hicif(:,:)=hicif(:,:) + zhicifinc(:,:) 
     1092            phicif(:,:)=phicif(:,:)        
     1093 
     1094! seaice salinity balancing (to add) 
     1095   
    10811096#endif 
    10821097  
    10831098#if defined key_cice 
    1084             ! Sea-ice : CICE case. Pass ice increment tendency into CICE - is this correct? 
     1099 
     1100! Pass ice increment tendency into CICE - is this correct? 
    10851101           ndaice_da(:,:) = seaice_bkginc(:,:) / rdt 
     1102 
    10861103#endif 
    10871104           IF ( .NOT. PRESENT(kindic) ) THEN 
     
    10921109 
    10931110#if defined key_cice 
    1094             ! Sea-ice : CICE case. Zero ice increment tendency into CICE  
     1111 
     1112! Zero ice increment tendency into CICE  
    10951113            ndaice_da(:,:) = 0.0_wp 
     1114 
    10961115#endif 
    10971116          
    10981117         ENDIF 
    10991118 
    1100 !#if defined defined key_lim2 || defined key_cice 
     1119!#if defined key_lim2 || defined key_cice 
    11011120! 
    11021121!            IF (ln_seaicebal ) THEN        
     
    11731192!#endif 
    11741193 
     1194 
    11751195      ENDIF 
    11761196 
    11771197   END SUBROUTINE seaice_asm_inc 
    1178     
    11791198   !!====================================================================== 
    11801199END MODULE asminc 
Note: See TracChangeset for help on using the changeset viewer.