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 5208 for branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/NEMO/LIM_SRC_3/limwri.F90 – NEMO

Ignore:
Timestamp:
2015-04-13T15:08:59+02:00 (9 years ago)
Author:
davestorkey
Message:

Merge in changes from trunk up to 5021.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/NEMO/LIM_SRC_3/limwri.F90

    r4688 r5208  
    3535   PUBLIC lim_wri_state  ! called by dia_wri_state  
    3636 
    37    REAL(wp)  ::   epsi06 = 1.e-6_wp 
    3837   !!---------------------------------------------------------------------- 
    3938   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011) 
     
    5958      INTEGER, INTENT(in) ::   kindic   ! if kindic < 0 there has been an error somewhere 
    6059      ! 
    61       INTEGER ::  ji, jj, jk, jl  ! dummy loop indices 
    62       REAL(wp) ::  zinda, zindb, z1_365 
    63       REAL(wp), POINTER, DIMENSION(:,:,:) ::   zoi, zei 
    64       REAL(wp), POINTER, DIMENSION(:,:)   :: z2d, z2da, z2db, zind    ! 2D workspace 
     60      INTEGER  ::  ji, jj, jk, jl  ! dummy loop indices 
     61      REAL(wp) ::  z1_365 
     62      REAL(wp) ::  ztmp 
     63      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zoi, zei 
     64      REAL(wp), POINTER, DIMENSION(:,:)   ::  z2d, z2da, z2db, zswi    ! 2D workspace 
    6565      !!------------------------------------------------------------------- 
    6666 
     
    6868 
    6969      CALL wrk_alloc( jpi, jpj, jpl, zoi, zei ) 
    70       CALL wrk_alloc( jpi, jpj     , z2d, z2da, z2db, zind ) 
     70      CALL wrk_alloc( jpi, jpj     , z2d, z2da, z2db, zswi ) 
    7171 
    7272      !----------------------------- 
     
    8080      DO jj = 1, jpj          ! presence indicator of ice 
    8181         DO ji = 1, jpi 
    82             zind(ji,jj)  = MAX( 0._wp , SIGN( 1._wp , at_i(ji,jj) - epsi06 ) ) 
     82            zswi(ji,jj)  = MAX( 0._wp , SIGN( 1._wp , at_i(ji,jj) - epsi06 ) ) 
    8383         END DO 
    8484      END DO 
     
    8989         DO jj = 1, jpj  
    9090            DO ji = 1, jpi 
    91                z2d(ji,jj)  = vt_i(ji,jj) / MAX( at_i(ji,jj), epsi06 ) * zind(ji,jj) 
     91               z2d(ji,jj)  = vt_i(ji,jj) / MAX( at_i(ji,jj), epsi06 ) * zswi(ji,jj) 
    9292            END DO 
    9393         END DO 
     
    9898         DO jj = 1, jpj                                             
    9999            DO ji = 1, jpi 
    100                z2d(ji,jj)  = vt_s(ji,jj) / MAX( at_i(ji,jj), epsi06 ) * zind(ji,jj) 
     100               z2d(ji,jj)  = vt_s(ji,jj) / MAX( at_i(ji,jj), epsi06 ) * zswi(ji,jj) 
    101101            END DO 
    102102         END DO 
     
    128128            DO jj = 1, jpj 
    129129               DO ji = 1, jpi 
    130                   z2d(ji,jj) = z2d(ji,jj) + zind(ji,jj) * oa_i(ji,jj,jl) 
     130                  z2d(ji,jj) = z2d(ji,jj) + zswi(ji,jj) * oa_i(ji,jj,jl) 
    131131               END DO 
    132132            END DO 
     
    139139         DO jj = 1, jpj 
    140140            DO ji = 1, jpi 
    141                z2d(ji,jj) = ( tm_i(ji,jj) - rtt ) * zind(ji,jj) 
     141               z2d(ji,jj) = ( tm_i(ji,jj) - rtt ) * zswi(ji,jj) 
    142142            END DO 
    143143         END DO 
     
    150150            DO jj = 1, jpj 
    151151               DO ji = 1, jpi 
    152                   z2d(ji,jj) = z2d(ji,jj) + zind(ji,jj) * ( t_su(ji,jj,jl) - rtt ) * a_i(ji,jj,jl) / MAX( at_i(ji,jj) , epsi06 ) 
     152                  z2d(ji,jj) = z2d(ji,jj) + zswi(ji,jj) * ( t_su(ji,jj,jl) - rtt ) * a_i(ji,jj,jl) / MAX( at_i(ji,jj) , epsi06 ) 
    153153               END DO 
    154154            END DO 
     
    160160         DO jj = 1, jpj 
    161161            DO ji = 1, jpi 
    162                zindb  = MAX( 0._wp , SIGN( 1._wp , at_i(ji,jj) ) ) 
    163                z2d(ji,jj) = hicol(ji,jj) * zindb 
     162               rswitch  = MAX( 0._wp , SIGN( 1._wp , at_i(ji,jj) ) ) 
     163               z2d(ji,jj) = hicol(ji,jj) * rswitch 
    164164            END DO 
    165165         END DO 
     
    199199      CALL iom_put( "sfx"         , sfx     * rday      )        ! total salt flux 
    200200 
    201       CALL iom_put( "vfxres"     , wfx_res * rday / rhoic  )        ! daily prod./melting due to limupdate  
    202       CALL iom_put( "vfxopw"     , wfx_opw * rday / rhoic  )        ! daily lateral thermodynamic ice production 
    203       CALL iom_put( "vfxsni"     , wfx_sni * rday / rhoic  )        ! daily snowice ice production 
    204       CALL iom_put( "vfxbog"     , wfx_bog * rday / rhoic  )       ! daily bottom thermodynamic ice production 
    205       CALL iom_put( "vfxdyn"     , wfx_dyn * rday / rhoic  )       ! daily dynamic ice production (rid/raft) 
    206       CALL iom_put( "vfxsum"     , wfx_sum * rday / rhoic  )        ! surface melt  
    207       CALL iom_put( "vfxbom"     , wfx_bom * rday / rhoic  )        ! bottom melt  
    208       CALL iom_put( "vfxice"     , wfx_ice * rday / rhoic  )        ! total ice growth/melt  
    209       CALL iom_put( "vfxsnw"     , wfx_snw * rday / rhoic  )        ! total snw growth/melt  
    210       CALL iom_put( "vfxsub"     , wfx_sub * rday / rhoic  )        ! sublimation (snow)  
    211       CALL iom_put( "vfxspr"     , wfx_spr * rday / rhoic  )        ! precip (snow)  
     201      ztmp = rday / rhoic 
     202      CALL iom_put( "vfxres"     , wfx_res * ztmp  )             ! daily prod./melting due to limupdate  
     203      CALL iom_put( "vfxopw"     , wfx_opw * ztmp  )             ! daily lateral thermodynamic ice production 
     204      CALL iom_put( "vfxsni"     , wfx_sni * ztmp  )             ! daily snowice ice production 
     205      CALL iom_put( "vfxbog"     , wfx_bog * ztmp  )             ! daily bottom thermodynamic ice production 
     206      CALL iom_put( "vfxdyn"     , wfx_dyn * ztmp  )             ! daily dynamic ice production (rid/raft) 
     207      CALL iom_put( "vfxsum"     , wfx_sum * ztmp  )             ! surface melt  
     208      CALL iom_put( "vfxbom"     , wfx_bom * ztmp  )             ! bottom melt  
     209      CALL iom_put( "vfxice"     , wfx_ice * ztmp  )             ! total ice growth/melt  
     210      CALL iom_put( "vfxsnw"     , wfx_snw * ztmp  )             ! total snw growth/melt  
     211      CALL iom_put( "vfxsub"     , wfx_sub * ztmp  )             ! sublimation (snow)  
     212      CALL iom_put( "vfxspr"     , wfx_spr * ztmp  )             ! precip (snow)  
    212213 
    213214      CALL iom_put ('hfxthd', hfx_thd(:,:) )   !   
     
    243244            DO jj = 1, jpj 
    244245               DO ji = 1, jpi 
    245                   zinda = MAX( 0._wp , SIGN( 1._wp , a_i(ji,jj,jl) - epsi06 ) ) 
    246                   zoi(ji,jj,jl) = oa_i(ji,jj,jl)  / MAX( a_i(ji,jj,jl) , epsi06 ) * zinda 
     246                  rswitch = MAX( 0._wp , SIGN( 1._wp , a_i(ji,jj,jl) - epsi06 ) ) 
     247                  zoi(ji,jj,jl) = oa_i(ji,jj,jl)  / MAX( a_i(ji,jj,jl) , epsi06 ) * rswitch 
    247248               END DO 
    248249            END DO 
     
    258259               DO jj = 1, jpj 
    259260                  DO ji = 1, jpi 
    260                      zinda = MAX( 0._wp , SIGN( 1._wp , a_i(ji,jj,jl) - epsi06 ) ) 
     261                     rswitch = MAX( 0._wp , SIGN( 1._wp , a_i(ji,jj,jl) - epsi06 ) ) 
    261262                     zei(ji,jj,jl) = zei(ji,jj,jl) + 100.0* & 
    262263                        ( - tmut * s_i(ji,jj,jk,jl) / MIN( ( t_i(ji,jj,jk,jl) - rtt ), - epsi06 ) ) * & 
    263                         zinda / nlay_i 
     264                        rswitch / nlay_i 
    264265                  END DO 
    265266               END DO 
     
    274275       
    275276      CALL wrk_dealloc( jpi, jpj, jpl, zoi, zei ) 
    276       CALL wrk_dealloc( jpi, jpj     , z2d, zind, z2da, z2db ) 
     277      CALL wrk_dealloc( jpi, jpj     , z2d, zswi, z2da, z2db ) 
    277278 
    278279      IF( nn_timing == 1 )  CALL timing_stop('limwri') 
     
    298299      !!---------------------------------------------------------------------- 
    299300 
    300       CALL histdef( kid, "iicethic", "Ice thickness"           , "m"      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    301       CALL histdef( kid, "iiceconc", "Ice concentration"       , "%"      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    302       CALL histdef( kid, "iicetemp", "Ice temperature"         , "C"      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    303       CALL histdef( kid, "iicevelu", "i-Ice speed (I-point)"   , "m/s"    , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    304       CALL histdef( kid, "iicevelv", "j-Ice speed (I-point)"   , "m/s"    , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )  
    305       CALL histdef( kid, "iicestru", "i-Wind stress over ice (I-pt)", "Pa", jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    306       CALL histdef( kid, "iicestrv", "j-Wind stress over ice (I-pt)", "Pa", jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )  
    307       CALL histdef( kid, "iicesflx", "Solar flux over ocean"     , "w/m2"   , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )  
    308       CALL histdef( kid, "iicenflx", "Non-solar flux over ocean" , "w/m2"   , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    309       CALL histdef( kid, "isnowpre", "Snow precipitation"      , "kg/m2/s", jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )  
    310       CALL histdef( kid, "iicesali", "Ice salinity"            , "PSU"    , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )  
    311       CALL histdef( kid, "iicevolu", "Ice volume"              , "m"      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )  
    312       CALL histdef( kid, "iicedive", "Ice divergence"          , "10-8s-1", jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )  
    313       CALL histdef( kid, "iicebopr", "Ice bottom production"   , "m/s"      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    314       CALL histdef( kid, "iicedypr", "Ice dynamic production"  , "m/s"      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    315       CALL histdef( kid, "iicelapr", "Ice open water prod"     , "m/s"      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    316       CALL histdef( kid, "iicesipr", "Snow ice production "    , "m/s"      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    317       CALL histdef( kid, "iicerepr", "Ice prod from limupdate" , "m/s"      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    318       CALL histdef( kid, "iicebome", "Ice bottom melt"         , "m/s"      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    319       CALL histdef( kid, "iicesume", "Ice surface melt"        , "m/s"      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    320       CALL histdef( kid, "iisfxdyn", "Salt flux from dynmics"  , ""      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    321       CALL histdef( kid, "iisfxres", "Salt flux from limupdate", ""      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     301      CALL histdef( kid, "iicethic", "Ice thickness"           , "m"      ,   & 
     302      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     303      CALL histdef( kid, "iiceconc", "Ice concentration"       , "%"      ,   & 
     304      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     305      CALL histdef( kid, "iicetemp", "Ice temperature"         , "C"      ,   & 
     306      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     307      CALL histdef( kid, "iicevelu", "i-Ice speed (I-point)"   , "m/s"    ,   & 
     308      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     309      CALL histdef( kid, "iicevelv", "j-Ice speed (I-point)"   , "m/s"    ,   & 
     310      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )  
     311      CALL histdef( kid, "iicestru", "i-Wind stress over ice (I-pt)", "Pa",   & 
     312      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     313      CALL histdef( kid, "iicestrv", "j-Wind stress over ice (I-pt)", "Pa",   & 
     314      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )  
     315      CALL histdef( kid, "iicesflx", "Solar flux over ocean"     , "w/m2" ,   & 
     316      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )  
     317      CALL histdef( kid, "iicenflx", "Non-solar flux over ocean" , "w/m2" ,   & 
     318      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     319      CALL histdef( kid, "isnowpre", "Snow precipitation"      , "kg/m2/s",   & 
     320      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )  
     321      CALL histdef( kid, "iicesali", "Ice salinity"            , "PSU"    ,   & 
     322      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )  
     323      CALL histdef( kid, "iicevolu", "Ice volume"              , "m"      ,   & 
     324      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )  
     325      CALL histdef( kid, "iicedive", "Ice divergence"          , "10-8s-1",   & 
     326      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )  
     327      CALL histdef( kid, "iicebopr", "Ice bottom production"   , "m/s"    ,   & 
     328      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     329      CALL histdef( kid, "iicedypr", "Ice dynamic production"  , "m/s"    ,   & 
     330      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     331      CALL histdef( kid, "iicelapr", "Ice open water prod"     , "m/s"    ,   & 
     332      &       jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     333      CALL histdef( kid, "iicesipr", "Snow ice production "    , "m/s"    ,   & 
     334      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     335      CALL histdef( kid, "iicerepr", "Ice prod from limupdate" , "m/s"    ,   & 
     336      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     337      CALL histdef( kid, "iicebome", "Ice bottom melt"         , "m/s"    ,   & 
     338      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     339      CALL histdef( kid, "iicesume", "Ice surface melt"        , "m/s"    ,   & 
     340      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     341      CALL histdef( kid, "iisfxdyn", "Salt flux from dynmics"  , ""       ,   & 
     342      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     343      CALL histdef( kid, "iisfxres", "Salt flux from limupdate", ""       ,   & 
     344      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    322345 
    323346      CALL histend( kid, snc4set )   ! end of the file definition 
Note: See TracChangeset for help on using the changeset viewer.