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 921 for trunk/NEMO/LIM_SRC_3/limwri.F90 – NEMO

Ignore:
Timestamp:
2008-05-13T10:28:52+02:00 (16 years ago)
Author:
rblod
Message:

Correct indentation and print for debug in LIM3, see ticket #134, step I

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/LIM_SRC_3/limwri.F90

    r888 r921  
    8585      !!------------------------------------------------------------------- 
    8686      INTEGER, INTENT(in) :: & 
    87           kindic                 ! if kindic < 0 there has been an error somewhere 
     87         kindic                 ! if kindic < 0 there has been an error somewhere 
    8888 
    8989      !! * Local variables 
    9090      REAL(wp),DIMENSION(1) ::   zdept 
    91        
     91 
    9292      REAL(wp) :: & 
    9393         zsto, zsec, zjulian,zout, & 
     
    9696         zcmo,               & 
    9797         zcmoa                   ! additional fields 
    98           
     98 
    9999      REAL(wp), DIMENSION(jpi,jpj) ::  & 
    100100         zfield 
     
    118118         ndexitd 
    119119      !!------------------------------------------------------------------- 
    120        
     120 
    121121      ipl = jpl 
    122122 
     
    124124 
    125125         CALL lim_wri_init  
    126           
     126 
    127127         WRITE(numout,*) ' lim_wri, first time step ' 
    128128         WRITE(numout,*) ' add_diag_swi ', add_diag_swi 
     
    135135         ! Normal file 
    136136         !------------- 
    137           
     137 
    138138         zsto     = rdt_ice 
    139139         clop     = "ave(x)" 
     
    148148         CALL histvert( nice, "deptht", "Vertical T levels", "m", 1, zdept, ndepid) 
    149149         CALL wheneq  ( jpij , tmask(:,:,1), 1, 1., ndex51, ndim) 
    150           
     150 
    151151         DO jf = 1 , noumef 
    152152            WRITE(numout,*) 'jf', jf 
     
    160160 
    161161         CALL histend(nice) 
    162           
     162 
    163163         !----------------- 
    164164         ! ITD file output 
     
    173173         CALL dia_nam ( clhstnama, nwrite, 'icemoa' ) 
    174174         CALL histbeg ( clhstnama, jpi, glamt, jpj, gphit,         & 
    175                         1, jpi, 1, jpj,        & ! zoom 
    176                         0, zjulian, rdt_ice,   & ! time 
    177                         nhorida,               & ! ? linked with horizontal ... 
    178                         nicea , domain_id=nidom)                  ! file  
     175            1, jpi, 1, jpj,        & ! zoom 
     176            0, zjulian, rdt_ice,   & ! time 
     177            nhorida,               & ! ? linked with horizontal ... 
     178            nicea , domain_id=nidom)                  ! file  
    179179         CALL histvert( nicea, "icethi", "L levels",               & 
    180                         "m", ipl , hi_mean , nz ) 
     180            "m", ipl , hi_mean , nz ) 
    181181         DO jl = 1, jpl 
    182182            zmaskitd(:,:,jl) = tmask(:,:,1) 
     
    185185         CALL wheneq( jpi*jpj*jpl, zmaskitd, 1, 1., ndexitd, ndimitd  )   
    186186         CALL histdef( nicea, "iice_itd", "Ice area in categories"         , "-"    ,   &   
    187                        jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
     187            jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
    188188         CALL histdef( nicea, "iice_hid", "Ice thickness in categories"    , "m"    ,   &   
    189                        jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
     189            jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
    190190         CALL histdef( nicea, "iice_hsd", "Snow depth in in categories"    , "m"    ,   &   
    191                        jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
     191            jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
    192192         CALL histdef( nicea, "iice_std", "Ice salinity distribution"      , "ppt"  ,   &   
    193                        jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
     193            jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
    194194         CALL histdef( nicea, "iice_otd", "Ice age distribution"               , "days",   &   
    195                        jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
     195            jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
    196196         CALL histdef( nicea, "iice_etd", "Brine volume distr. "               , "%"    ,   &   
    197                        jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
     197            jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
    198198         CALL histend(nicea) 
    199199      ENDIF 
    200        
    201 !     !-----------------------------------------------------------------------! 
    202 !     !--2. Computation of instantaneous values                               !  
    203 !     !-----------------------------------------------------------------------! 
    204  
    205 !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
     200 
     201      !     !-----------------------------------------------------------------------! 
     202      !     !--2. Computation of instantaneous values                               !  
     203      !     !-----------------------------------------------------------------------! 
     204 
     205      !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
    206206      IF(lwp) THEN 
    207207         WRITE(numout,*) 
     
    210210         WRITE(numout,*) ' kindic = ', kindic 
    211211      ENDIF 
    212 !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
     212      !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
    213213 
    214214      !-- calculs des valeurs instantanees 
     
    229229 
    230230      CALL lim_var_bv 
    231        
     231 
    232232      DO jj = 2 , jpjm1 
    233233         DO ji = 2 , jpim1 
     
    240240            zcmo(ji,jj,3)  = vt_s(ji,jj)/MAX(at_i(ji,jj),epsi16)*zinda 
    241241            zcmo(ji,jj,4)  = diag_bot_gr(ji,jj) * & 
    242                              86400.0 * zinda !Bottom thermodynamic ice production 
     242               86400.0 * zinda !Bottom thermodynamic ice production 
    243243            zcmo(ji,jj,5)  = diag_dyn_gr(ji,jj) * & 
    244                              86400.0 * zinda !Dynamic ice production (rid/raft) 
     244               86400.0 * zinda !Dynamic ice production (rid/raft) 
    245245            zcmo(ji,jj,22) = diag_lat_gr(ji,jj) * & 
    246                              86400.0 * zinda !Lateral thermodynamic ice production 
     246               86400.0 * zinda !Lateral thermodynamic ice production 
    247247            zcmo(ji,jj,23) = diag_sni_gr(ji,jj) * & 
    248                              86400.0 * zinda !Snow ice production ice production 
     248               86400.0 * zinda !Snow ice production ice production 
    249249            zcmo(ji,jj,24) = tm_i(ji,jj) - rtt 
    250250 
    251251            zcmo(ji,jj,6)  = fbif  (ji,jj) 
    252252            zcmo(ji,jj,7)  = zindb * (  u_ice(ji,jj  ) * tmu(ji,jj)        & 
    253      &                                + u_ice(ji-1,jj) * tmu(ji-1,jj) )    & 
    254      &                     / 2.0  
     253               &                                + u_ice(ji-1,jj) * tmu(ji-1,jj) )    & 
     254               &                     / 2.0  
    255255            zcmo(ji,jj,8)  = zindb * (  v_ice(ji,jj  ) * tmv(ji,jj)        & 
    256      &                                + v_ice(ji,jj-1) * tmv(ji,jj-1) )    & 
    257      &                     / 2.0 
     256               &                                + v_ice(ji,jj-1) * tmv(ji,jj-1) )    & 
     257               &                     / 2.0 
    258258            zcmo(ji,jj,9)  = sst_m(ji,jj) 
    259259            zcmo(ji,jj,10) = sss_m(ji,jj) 
     
    274274            zcmo(ji,jj,28) = fsbri(ji,jj) 
    275275            zcmo(ji,jj,29) = fseqv(ji,jj) 
    276            
     276 
    277277            zcmo(ji,jj,30) = bv_i(ji,jj) 
    278278            zcmo(ji,jj,31) = hicol(ji,jj) 
    279279            zcmo(ji,jj,32) = strength(ji,jj) 
    280280            zcmo(ji,jj,33) = SQRT( zcmo(ji,jj,7)*zcmo(ji,jj,7) + & 
    281                                    zcmo(ji,jj,8)*zcmo(ji,jj,8) ) 
     281               zcmo(ji,jj,8)*zcmo(ji,jj,8) ) 
    282282            zcmo(ji,jj,34) = diag_sur_me(ji,jj) * & 
    283                              86400.0 * zinda ! Surface melt 
     283               86400.0 * zinda ! Surface melt 
    284284            zcmo(ji,jj,35) = diag_bot_me(ji,jj) * & 
    285                              86400.0 * zinda ! Bottom melt 
     285               86400.0 * zinda ! Bottom melt 
    286286            zcmo(ji,jj,36) = divu_i(ji,jj) 
    287287            zcmo(ji,jj,37) = shear_i(ji,jj) 
     
    299299            END DO 
    300300         END DO 
    301           
     301 
    302302         IF ( jf == 7  .OR. jf == 8  .OR. jf == 15 .OR. jf == 16 ) THEN  
    303303            CALL lbc_lnk( zfield, 'T', -1. ) 
     
    306306         ENDIF 
    307307 
    308 !+++++ 
     308         !+++++ 
    309309         WRITE(numout,*) 
    310310         WRITE(numout,*) 'nc(jf), nice, nam(jf), niter, ndim' 
    311311         WRITE(numout,*) nc(jf), nice, nam(jf), niter, ndim 
    312 !+++++ 
     312         !+++++ 
    313313         IF ( nc(jf) == 1 ) CALL histwrite( nice, nam(jf), niter, zfield, ndim, ndex51 ) 
    314           
     314 
    315315      END DO 
    316316 
    317317      IF ( ( nn_fsbc * niter + nit000 - 1 ) >= nitend .OR. kindic < 0 ) THEN 
    318           WRITE(numout,*) ' Closing the icemod file ' 
    319           CALL histclo( nice ) 
     318         WRITE(numout,*) ' Closing the icemod file ' 
     319         CALL histclo( nice ) 
    320320      ENDIF 
    321321 
     
    325325      IF ( add_diag_swi .EQ. 1 ) THEN 
    326326 
    327       DO jl = 1, jpl  
    328          CALL lbc_lnk( a_i(:,:,jl)  , 'T' ,  1. ) 
    329          CALL lbc_lnk( sm_i(:,:,jl) , 'T' ,  1. ) 
    330          CALL lbc_lnk( oa_i(:,:,jl) , 'T' ,  1. ) 
    331          CALL lbc_lnk( ht_i(:,:,jl) , 'T' ,  1. ) 
    332          CALL lbc_lnk( ht_s(:,:,jl) , 'T' ,  1. ) 
    333       END DO 
    334  
    335       ! Compute ice age 
    336       DO jl = 1, jpl  
    337          DO jj = 1, jpj 
    338             DO ji = 1, jpi 
    339                zinda = MAX( zzero , SIGN( zone , a_i(ji,jj,jl) - 1.0e-6 ) ) 
    340                zoi(ji,jj,jl) = oa_i(ji,jj,jl)  / MAX( a_i(ji,jj,jl) , 1.0e-6 ) * & 
    341                                zinda 
    342             END DO 
    343          END DO 
    344       END DO         
    345  
    346       ! Compute brine volume 
    347       zei(:,:,:) = 0.0 
    348       DO jl = 1, jpl  
    349          DO jk = 1, nlay_i 
     327         DO jl = 1, jpl  
     328            CALL lbc_lnk( a_i(:,:,jl)  , 'T' ,  1. ) 
     329            CALL lbc_lnk( sm_i(:,:,jl) , 'T' ,  1. ) 
     330            CALL lbc_lnk( oa_i(:,:,jl) , 'T' ,  1. ) 
     331            CALL lbc_lnk( ht_i(:,:,jl) , 'T' ,  1. ) 
     332            CALL lbc_lnk( ht_s(:,:,jl) , 'T' ,  1. ) 
     333         END DO 
     334 
     335         ! Compute ice age 
     336         DO jl = 1, jpl  
    350337            DO jj = 1, jpj 
    351338               DO ji = 1, jpi 
    352339                  zinda = MAX( zzero , SIGN( zone , a_i(ji,jj,jl) - 1.0e-6 ) ) 
    353                   zei(ji,jj,jl) = zei(ji,jj,jl) + 100.0* & 
    354                                 ( - tmut * s_i(ji,jj,jk,jl) / MIN( ( t_i(ji,jj,jk,jl) - rtt ), -1.0e-6 ) ) * & 
    355                                   zinda / nlay_i 
     340                  zoi(ji,jj,jl) = oa_i(ji,jj,jl)  / MAX( a_i(ji,jj,jl) , 1.0e-6 ) * & 
     341                     zinda 
    356342               END DO 
    357343            END DO 
    358344         END DO 
    359       END DO 
    360  
    361       DO jl = 1, jpl  
    362          CALL lbc_lnk( zei(:,:,jl) , 'T' ,  1. ) 
    363       END DO 
    364  
    365       CALL histwrite( nicea, "iice_itd", niter, a_i  , ndimitd , ndexitd  )   ! area 
    366       CALL histwrite( nicea, "iice_hid", niter, ht_i , ndimitd , ndexitd  )   ! thickness 
    367       CALL histwrite( nicea, "iice_hsd", niter, ht_s , ndimitd , ndexitd  )   ! snow depth 
    368       CALL histwrite( nicea, "iice_std", niter, sm_i , ndimitd , ndexitd  )   ! salinity 
    369       CALL histwrite( nicea, "iice_otd", niter, zoi  , ndimitd , ndexitd  )   ! age 
    370       CALL histwrite( nicea, "iice_etd", niter, zei  , ndimitd , ndexitd  )   ! brine volume 
    371           
    372 !     !  Create an output files (output.lim.abort.nc) if S < 0 or u > 20 m/s 
    373 !     IF( kindic < 0 )   CALL lim_wri_state( 'output.abort' ) 
    374 !     not yet implemented 
    375        
    376       IF ( ( nn_fsbc * niter + nit000 - 1 ) >= nitend .OR. kindic < 0 ) THEN 
    377          WRITE(numout,*) ' Closing the icemod file ' 
    378          CALL histclo( nicea )  
    379       ENDIF 
     345 
     346         ! Compute brine volume 
     347         zei(:,:,:) = 0.0 
     348         DO jl = 1, jpl  
     349            DO jk = 1, nlay_i 
     350               DO jj = 1, jpj 
     351                  DO ji = 1, jpi 
     352                     zinda = MAX( zzero , SIGN( zone , a_i(ji,jj,jl) - 1.0e-6 ) ) 
     353                     zei(ji,jj,jl) = zei(ji,jj,jl) + 100.0* & 
     354                        ( - tmut * s_i(ji,jj,jk,jl) / MIN( ( t_i(ji,jj,jk,jl) - rtt ), -1.0e-6 ) ) * & 
     355                        zinda / nlay_i 
     356                  END DO 
     357               END DO 
     358            END DO 
     359         END DO 
     360 
     361         DO jl = 1, jpl  
     362            CALL lbc_lnk( zei(:,:,jl) , 'T' ,  1. ) 
     363         END DO 
     364 
     365         CALL histwrite( nicea, "iice_itd", niter, a_i  , ndimitd , ndexitd  )   ! area 
     366         CALL histwrite( nicea, "iice_hid", niter, ht_i , ndimitd , ndexitd  )   ! thickness 
     367         CALL histwrite( nicea, "iice_hsd", niter, ht_s , ndimitd , ndexitd  )   ! snow depth 
     368         CALL histwrite( nicea, "iice_std", niter, sm_i , ndimitd , ndexitd  )   ! salinity 
     369         CALL histwrite( nicea, "iice_otd", niter, zoi  , ndimitd , ndexitd  )   ! age 
     370         CALL histwrite( nicea, "iice_etd", niter, zei  , ndimitd , ndexitd  )   ! brine volume 
     371 
     372         !     !  Create an output files (output.lim.abort.nc) if S < 0 or u > 20 m/s 
     373         !     IF( kindic < 0 )   CALL lim_wri_state( 'output.abort' ) 
     374         !     not yet implemented 
     375 
     376         IF ( ( nn_fsbc * niter + nit000 - 1 ) >= nitend .OR. kindic < 0 ) THEN 
     377            WRITE(numout,*) ' Closing the icemod file ' 
     378            CALL histclo( nicea )  
     379         ENDIF 
    380380 
    381381      ENDIF 
     
    472472      zfield(36) = field_36 
    473473      zfield(37) = field_37 
    474        
     474 
    475475      DO nf = 1, noumef 
    476476         titn  (nf) = zfield(nf)%ztitle 
     
    495495         WRITE(numout,*) ' add_diag_swi ', add_diag_swi 
    496496      ENDIF 
    497              
     497 
    498498   END SUBROUTINE lim_wri_init 
    499499 
Note: See TracChangeset for help on using the changeset viewer.