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 632 for trunk/NEMO/OPA_SRC – NEMO

Changeset 632 for trunk/NEMO/OPA_SRC


Ignore:
Timestamp:
2007-03-02T17:45:17+01:00 (17 years ago)
Author:
opalod
Message:

nemo_v2_bugfix_026 : CT : -add key_flx_core to save in restart files the nfbulk parameter and the gsst(:,:) field when using CORE forcing

  • save surface fluxes qla, qsb and qlw
Location:
trunk/NEMO/OPA_SRC
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DIA/diawri.F90

    r460 r632  
    120120      CHARACTER (len=80) :: clname 
    121121      !!---------------------------------------------------------------------- 
    122        
     122 
    123123      ! 0. Initialisation 
    124124      ! ----------------- 
    125        
     125 
    126126      ! local variable for debugging 
    127127      ll_print = .FALSE. 
     
    160160 
    161161         ! Define the NETCDF files (one per grid) 
    162           
     162 
    163163         ! Compute julian date from starting date of the run 
    164164         CALL ymds2ju( nyear, nmonth, nday, 0.e0, zjulian ) 
     
    175175         WRITE(inum,*) clhstnam 
    176176         CLOSE(inum) 
    177           
     177 
    178178         ! Define the T grid FILE ( nid_T ) 
    179           
     179 
    180180         CALL dia_nam( clhstnam, nwrite, 'grid_T' ) 
    181181         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename 
     
    224224         CALL histvert( nid_W, "depthw", "Vertical W levels",      &  ! Vertical grid: gdepw 
    225225            &          "m", ipk, gdepw_0, nz_W ) 
    226   
     226 
    227227 
    228228         ! Declare all the output fields as NETCDF variables 
     
    280280            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    281281#endif 
     282 
     283#if defined key_flx_core 
     284         CALL histdef( nid_T, "solhflup", "Latent Heat Flux Upward"         , "W/m2"   ,   &  ! qla 
     285            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
     286         CALL histdef( nid_T, "solwfldo", "Longwave Radiation downward"     , "W/m2"   ,   &  ! qlw 
     287            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
     288         CALL histdef( nid_T, "sosbhfup", "Sensible Heat Flux upward"       , "W/m2"   ,   &  ! qsb 
     289            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
     290#endif 
     291 
    282292 
    283293#if ( defined key_coupled && ! defined key_ice_lim )  
     
    432442      zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1) 
    433443      CALL histwrite( nid_T, "sosafldp", it, zw2d          , ndim_hT, ndex_hT )   ! salt flux damping 
     444#endif 
     445#if defined key_flx_core 
     446      CALL histwrite( nid_T, "solhflup", it, qla           , ndim_hT, ndex_hT )   ! latent heat flux 
     447      CALL histwrite( nid_T, "solwfldo", it, qlw           , ndim_hT, ndex_hT )   ! longwave heat flux 
     448      CALL histwrite( nid_T, "sosbhfup", it, qsb           , ndim_hT, ndex_hT )   ! sensible heat flux 
    434449#endif 
    435450#if ( defined key_coupled && ! defined key_ice_lim )  
     
    556571      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~   and forcing fields file created ' 
    557572      IF(lwp) WRITE(numout,*) '                and named :', cdfile_name, '.nc' 
    558        
     573 
    559574      ! 0. Initialisation 
    560575      ! ----------------- 
    561        
     576 
    562577      ! Define frequency of output and means 
    563578      zdt  = rdt 
     
    617632      ! donne le nombre d'elements, et idex la liste des indices a sortir 
    618633      idex(1) = 1   ! init to avoid compil warning 
    619        
     634 
    620635      ! Write all fields on T grid 
    621636      CALL histwrite( id_i, "votemper", 1, tn    , jpi*jpj*jpk, idex )    ! now temperature 
     
    641656 
    642657   END SUBROUTINE dia_wri_state 
    643   
     658 
    644659#endif 
    645660   !!====================================================================== 
  • trunk/NEMO/OPA_SRC/DIA/diawri_dimg.h90

    r574 r632  
    8282 
    8383    !! * local declarations 
    84     INTEGER :: inbsel 
     84    INTEGER :: inbsel, jk 
    8585!!  INTEGER :: iwrite 
    8686    INTEGER :: iyear,imon,iday 
     
    113113    inbsel = 17 
    114114#endif 
     115#if defined key_flx_core 
     116    inbsel = 23 
     117#endif 
    115118 
    116119    IF( inbsel >  jpk) THEN 
     
    131134    ! 
    132135    IF( .NOT. ll_dia_inst ) THEN 
    133        !#if ! defined key_diainstant 
    134136       ! 
    135137       !! * Mean output section 
     
    191193       fsel(:,:,18) = fsel(:,:,18) + gps(:,:)/g  
    192194#endif 
     195#if defined key_flx_core 
     196       fsel(:,:,21) = fsel(:,:,21) + qla(:,:) 
     197       fsel(:,:,22) = fsel(:,:,22) + qlw(:,:) 
     198       fsel(:,:,23) = fsel(:,:,23) + qsb(:,:) 
     199#endif 
    193200       ! 
    194201       ! Output of dynamics and tracer fields and selected fields (numwri) 
     
    224231          fsel(:,:,20)= spgv(:,:) 
    225232#endif 
     233          ! mask mean field with tmask except taux tauy (1,2) 
     234          DO jk=3,inbsel 
     235            fsel(:,:,jk)=fsel(:,:,jk)*tmask(:,:,1) 
     236          END DO 
    226237       ENDIF 
    227238       ! 
    228239    ELSE   ! ll_dia_inst true 
    229        !#  else 
    230240       ! 
    231241       !! * Instantaneous output section 
     
    248258          fsel(:,:,1 ) = taux(:,:) * umask(:,:,1) 
    249259          fsel(:,:,2 ) = tauy(:,:) * vmask(:,:,1) 
    250           fsel(:,:,3 ) = qt  (:,:)  
    251           fsel(:,:,4 ) = emp (:,:) 
     260          fsel(:,:,3 ) = qt  (:,:) * tmask(:,:,1) 
     261          fsel(:,:,4 ) = emp (:,:) * tmask(:,:,1) 
    252262          fsel(:,:,5 ) = (tb  (:,:,1) -sst(:,:)) *tmask(:,:,1) 
    253263 
     
    257267          fsel(:,:,6 ) = bsfn(:,:) 
    258268#endif 
    259           fsel(:,:,7 ) = qsr (:,:) 
    260           fsel(:,:,8 ) = qrp (:,:) 
    261           fsel(:,:,9 ) = erp (:,:)*tmask(:,:,1) 
    262           fsel(:,:,10) = hmld(:,:)  
    263           fsel(:,:,11) = hmlp(:,:) 
    264           fsel(:,:,12) = freeze(:,:) 
     269          fsel(:,:,7 ) = qsr (:,:) * tmask(:,:,1) 
     270          fsel(:,:,8 ) = qrp (:,:) * tmask(:,:,1) 
     271          fsel(:,:,9 ) = erp (:,:) * tmask(:,:,1) 
     272          fsel(:,:,10) = hmld(:,:) * tmask(:,:,1) 
     273          fsel(:,:,11) = hmlp(:,:) * tmask(:,:,1) 
     274          fsel(:,:,12) = freeze(:,:) * tmask(:,:,1) 
    265275          fsel(:,:,13) =  sst(:,:)   
    266276          !         fsel(:,:,14) =  qct(:,:) 
    267277          !         fsel(:,:,15) =  fbt(:,:) 
    268           fsel(:,:,16) =  emps(:,:) 
     278          fsel(:,:,16) =  emps(:,:) * tmask(:,:,1) 
    269279#if defined key_ice_lim 
    270           fsel(:,:,17) =  fsalt(:,:) 
     280          fsel(:,:,17) =  fsalt(:,:) * tmask(:,:,1) 
    271281#endif 
    272282#ifdef key_diaspr            
     
    275285          fsel(:,:,20) =      spgv(:,:) 
    276286#endif 
     287#if defined key_flx_core 
     288          fsel(:,:,21) =  qla(:,:)* tmask(:,:,1) 
     289          fsel(:,:,22) =  qlw(:,:)* tmask(:,:,1) 
     290          fsel(:,:,23) =  qsb(:,:)* tmask(:,:,1) 
     291#endif 
    277292          ! 
    278293          !         qct(:,:) = 0._wp 
    279294       ENDIF 
    280        !#endif 
    281295    ENDIF 
    282296    ! 
  • trunk/NEMO/OPA_SRC/SBC/flx_oce.F90

    r247 r632  
    1616   IMPLICIT NONE 
    1717   PRIVATE 
    18     
     18 
    1919 
    2020   !!---------------------------------------------------------------------- 
     
    3030      p_emp             !: evaporation minus precipitation             
    3131 
    32 #elif defined key_ice_lim || defined key_flx_bulk_monthly || defined key_flx_bulk_daily 
     32#elif defined key_ice_lim || defined key_flx_bulk_monthly || defined key_flx_bulk_daily || defined key_flx_core 
    3333   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)    ::   &  !: 
    3434      qsr_ice  ,      &  !: solar flux over ice 
     
    5656   !!   Default option                                         Empty module 
    5757   !!---------------------------------------------------------------------- 
    58     
     58 
    5959#endif 
    6060 
  • trunk/NEMO/OPA_SRC/SBC/ocesbc.F90

    r602 r632  
    4242      qt  ,         &  !: total surface heat flux (w/m2) 
    4343      qsr ,         &  !: solar radiation (w/m2) 
     44      qla ,         &  !: Latent heat flux (W/m2) 
     45      qlw ,         &  !: Long Wave Heat Flux (W/m2) 
     46      qsb ,         &  !: Sensible Heat Flux (W/m2) 
    4447      emp ,         &  !: evaporation minus precipitation (kg/m2/s = mm/s) 
    4548      emps,         &  !: evaporation - precipitation (free surface) 
     
    9093      REAL(wp) ::   ztdta, ztgel, zqrp 
    9194      !!---------------------------------------------------------------------- 
    92   
     95 
    9396      ! 1. initialization to zero at kt = nit000 
    9497      ! --------------------------------------- 
    95        
     98 
    9699      IF( kt == nit000 ) THEN      
    97100         qsr   (:,:) = 0.e0 
     
    202205      ! 1. initialization to zero at kt = nit000 
    203206      ! --------------------------------------- 
    204        
     207 
    205208      IF( kt == nit000 ) THEN      
    206209         qsr    (:,:) = 0.e0 
    207210         qt     (:,:) = 0.e0 
     211         qla    (:,:) = 0.e0 
     212         qlw    (:,:) = 0.e0 
     213         qsb    (:,:) = 0.e0 
    208214         qrp    (:,:) = 0.e0 
    209215         emp    (:,:) = 0.e0 
     
    214220#endif 
    215221      ENDIF 
    216  
     222#if defined key_flx_core 
     223      qla(:,:) = (1 - freeze(:,:))*qla_oce + freeze(:,:)*qla_ice(:,:) 
     224      qsb(:,:) = (1 - freeze(:,:))*qsb_oce + freeze(:,:)*qsb_ice(:,:) 
     225      qlw(:,:) = (1 - freeze(:,:))*qlw_oce + freeze(:,:)*qlw_ice(:,:) 
     226#endif 
    217227      IF( MOD( kt-1, nfice ) == 0 ) THEN 
    218228 
     
    325335 
    326336            ! hemisphere indicator (=1 north, =-1 south) 
    327              
     337 
    328338            zhemis = float(isign(1, mjg(jj)-(jpjglo/2+1))) 
    329              
     339 
    330340            ! a) net downward radiative flux qsr() 
    331341            ! - AGCM qsrc if no ice 
     
    350360            zqi = -3. + zhemis 
    351361            qt(ji,jj) = ( (1.-zice) * zq + zice * zqi ) * tmask(ji,jj,1) + qrp(ji,jj) 
    352              
     362 
    353363            ! d) water flux damping term erp() 
    354364            ! - no damping 
    355365            zerp = 0. 
    356366            erp(ji,jj) = zerp 
    357              
     367 
    358368            ! e) net upward water flux e() = eo + runoff() + erp() 
    359369            ! for e0 
     
    364374            zro = runoff(ji,jj) 
    365375            emp(ji,jj) = ( ( 1. - zice ) *  ze + zice * zei + zro ) * tmask(ji,jj,1) + erp(ji,jj) 
    366              
     376 
    367377            ! f) net upward water flux for the salinity surface  
    368378            !    boundary condition 
     
    375385# elif defined key_flx_bulk_monthly || defined key_flx_bulk_daily || defined key_flx_forced_daily || defined key_flx_core 
    376386      !!------------------------------------------------------------------------- 
    377       !!   'key_flx_bulk_monthly' or 'key_flx_bulk_daily' or        bulk formulea 
     387      !!   'key_flx_bulk_monthly' or 'key_flx_bulk_daily' or  core   bulk formulea 
    378388      !!   'key_flx_forced_daily'                                or no bulk case  
    379389      !!------------------------------------------------------------------------- 
     
    397407      USE dtasst, ONLY : rclice  ! sea surface temperature data 
    398408#endif 
    399 #if defined key_flx_bulk_monthly || defined key_flx_bulk_daily 
     409#if defined key_flx_bulk_monthly || defined key_flx_bulk_daily || defined key_flx_core 
    400410      USE blk_oce                ! bulk variables 
    401411#endif 
     
    424434      ! 1. initialization to zero at kt = nit000 
    425435      ! --------------------------------------- 
    426        
     436 
    427437      IF( kt == nit000 ) THEN      
    428438         qsr    (:,:) = 0.e0 
    429439         freeze (:,:) = 0.e0 
    430440         qt     (:,:) = 0.e0 
     441         qla    (:,:) = 0.e0 
     442         qlw    (:,:) = 0.e0 
     443         qsb    (:,:) = 0.e0 
    431444         qrp    (:,:) = 0.e0 
    432445         emp    (:,:) = 0.e0 
     
    438451      ENDIF 
    439452 
    440 #if defined key_flx_bulk_monthly || defined key_flx_bulk_daily 
     453#if defined key_flx_bulk_monthly || defined key_flx_bulk_daily || defined key_flx_core 
    441454      ifreq      = nfbulk 
    442455      zqt (:,:)  = qsr_oce(:,:) + qnsr_oce(:,:) 
     
    451464      zemp(:,:)  = p_emp(:,:) 
    452465#endif  
    453  
     466#if defined key_flx_core 
     467      qla(:,:) = (1 - freeze(:,:))*qla_oce + freeze(:,:)*qla_ice(:,:) 
     468      qsb(:,:) = (1 - freeze(:,:))*qsb_oce + freeze(:,:)*qsb_ice(:,:) 
     469      qlw(:,:) = (1 - freeze(:,:))*qlw_oce + freeze(:,:)*qlw_ice(:,:) 
     470#endif  
    454471      IF( MOD( kt-1, ifreq) == 0 ) THEN 
    455472         ! Computation of internal and evaporation damping terms        
     
    491508                 &                                  + freeze(ji,jj)  * zqrj ) ) * tmask(ji,jj,1) 
    492509 
    493 #if ! defined key_flx_bulk_monthly && ! defined key_flx_bulk_daily 
     510#if ! defined key_flx_bulk_monthly && ! defined key_flx_bulk_daily && ! defined key_flx_core 
    494511               zqrp = dqdt0 * ( tb(ji,jj,1) - ztdta ) 
    495512               qrp(ji,jj) = qrp(ji,jj) + (1. - ziclim(ji,jj)) * zqrp 
     
    549566         ! ------------------------------------------------- 
    550567         CALL lbc_lnk( emp, 'T', 1. ) 
    551        
     568 
    552569      ENDIF 
    553570 
     
    757774            qrp   (:,:) = 0.e0 
    758775            erp   (:,:) = 0.e0 
    759     
     776 
    760777            runoff(:,:) = 0.e0 
    761778         ENDIF 
     
    856873      aplus  = 0.e0 
    857874      aminus = 0.e0 
    858        
     875 
    859876      IF( nbit_cmp == 1) THEN 
    860           
     877 
    861878         IF(ln_ctl)   THEN 
    862879            WRITE(charout,FMT="('oce_sbc_dmp : a+ = ',D23.16, ' a- = ',D23.16)") aplus, aminus 
     
    892909#else 
    893910      ! Rigid-lid (emp=emps=E-P-R+Erp) 
    894        
     911 
    895912      erp(:,:) = ( 1. - zfreeze(:,:) ) * zsrp    &   ! surface restoring term 
    896913         &     * ( zsss(:,:) - s_dta(:,:,1) )     & 
  • trunk/NEMO/OPA_SRC/restart.F90

    r611 r632  
    6969         lrst_oce = .FALSE. 
    7070      ENDIF 
    71        
     71 
    7272      IF    ( kt == nitrst-1 .AND. lrst_oce         ) THEN 
    7373         CALL ctl_stop( 'rst_opn: we cannot create an ocean restart at every time step',    & 
    74             &           'if the run ahs more than one tie step!!!' ) 
     74            &           'if the run has more than one time step!!!' ) 
    7575         numrow = 0 
    7676      ELSEIF( kt == nitrst-1 .OR.  nitend == nit000 ) THEN   ! beware if model runs only one time step 
     
    8585         IF(lwp) THEN 
    8686            WRITE(numout,*) 
    87             WRITE(numout,*) '             open ocean restart.output NetCDF file: '//clname 
     87            SELECT CASE ( jprstlib ) 
     88            CASE ( jpnf90 ) 
     89               WRITE(numout,*) '             open ocean restart.output NetCDF file: '//clname 
     90            CASE ( jprstdimg ) 
     91               WRITE(numout,*) '             open ocean restart.output binary file: '//clname 
     92            END SELECT 
    8893            IF( kt == nitrst-1 ) THEN 
    8994               WRITE(numout,*) '             kt = nitrst - 1 = ', kt,' date= ', ndastp 
     
    104109      !!                   ***  ROUTINE rstwrite  *** 
    105110      !!                      
    106       !! ** Purpose :   Write restart fields in NetCDF format 
     111      !! ** Purpose :   Write restart fields in the format corresponding to jprstlib 
    107112      !! 
    108113      !! ** Method  :   Write in numrow when kt == nitrst in NetCDF 
     
    134139      CALL iom_rstput( kt, nitrst, numrow, 'rotn'   , rotn    ) 
    135140      CALL iom_rstput( kt, nitrst, numrow, 'hdivn'  , hdivn   ) 
    136        
     141 
    137142#if defined key_ice_lim         
    138143      CALL iom_rstput( kt, nitrst, numrow, 'nfice'  , REAL( nfice, wp) )   !  ice computation frequency 
     
    145150# endif 
    146151#endif 
    147 #if defined key_flx_bulk_monthly || defined key_flx_bulk_daily 
     152#if defined key_flx_bulk_monthly || defined key_flx_bulk_daily || defined key_flx_core  
    148153      CALL iom_rstput( kt, nitrst, numrow, 'nfbulk' , REAL( nfbulk, wp) )   !  bulk computation frequency 
    149154      CALL iom_rstput( kt, nitrst, numrow, 'gsst'   , gsst    ) 
     
    175180      !!                   ***  ROUTINE rst_read  *** 
    176181      !!  
    177       !! ** Purpose :   Read files for restart 
     182      !! ** Purpose :   Read files for restart (format fixed by jprstlib ) 
    178183      !!  
    179       !! ** Method  :   Read the previous fields on the NetCDF file  
     184      !! ** Method  :   Read the previous fields on the NetCDF/binary file  
    180185      !!      the first record indicates previous characterics 
    181186      !!      after control with the present run, we read : 
     
    208213      IF(lwp) THEN                                             ! Contol prints 
    209214         WRITE(numout,*) 
    210          WRITE(numout,*) 'rst_read : read oce NetCDF restart file' 
     215         SELECT CASE ( jprstlib ) 
     216         CASE ( jpnf90 ) 
     217            WRITE(numout,*) 'rst_read : read oce NetCDF restart file' 
     218         CASE ( jprstdimg ) 
     219            WRITE(numout,*) 'rst_read : read oce binary restart file' 
     220         END SELECT 
    211221         WRITE(numout,*) '~~~~~~~~' 
    212           
     222 
    213223         WRITE(numout,*) ' *** Info on the present job : ' 
    214224         WRITE(numout,*) '   time-step           : ', nit000 
     
    329339      ENDIF 
    330340#endif 
    331 #if defined key_flx_bulk_monthly || defined key_flx_bulk_daily 
     341#if defined key_flx_bulk_monthly || defined key_flx_bulk_daily || defined key_flx_core  
    332342      ! Louvain La Neuve Sea Ice Model 
    333343      IF( iom_varid( numror, 'nfbulk' ) > 0 ) THEN  
     
    345355      ENDIF 
    346356#endif 
    347        
     357 
    348358      !!sm: end of TO BE MOVED IN NEW SURFACE MODULE... 
    349359 
Note: See TracChangeset for help on using the changeset viewer.