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 4827 for branches/UKMO/dev_3841_sbc/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90 – NEMO

Ignore:
Timestamp:
2014-10-31T12:45:41+01:00 (9 years ago)
Author:
charris
Message:

Some demonstration code changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_3841_sbc/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90

    r3772 r4827  
    2727   USE dom_oce         ! ocean space and time domain 
    2828   USE phycst          ! physical constants 
    29    USE fldread         ! read input fields 
     29   USE fldread2        ! read input fields 
     30   USE fld_def 
     31   USE sbcget 
    3032   USE sbc_oce         ! Surface boundary condition: ocean fields 
    3133   USE cyclone         ! Cyclone 10m wind form trac of cyclone centres 
     
    4951   PUBLIC   blk_ice_core         ! routine called in sbc_ice_lim module 
    5052   PUBLIC   turb_core_2z         ! routine calles in sbcblk_mfs module 
    51  
    52    INTEGER , PARAMETER ::   jpfld   = 9           ! maximum number of files to read  
    53    INTEGER , PARAMETER ::   jp_wndi = 1           ! index of 10m wind velocity (i-component) (m/s)    at T-point 
    54    INTEGER , PARAMETER ::   jp_wndj = 2           ! index of 10m wind velocity (j-component) (m/s)    at T-point 
    55    INTEGER , PARAMETER ::   jp_humi = 3           ! index of specific humidity               ( % ) 
    56    INTEGER , PARAMETER ::   jp_qsr  = 4           ! index of solar heat                      (W/m2) 
    57    INTEGER , PARAMETER ::   jp_qlw  = 5           ! index of Long wave                       (W/m2) 
    58    INTEGER , PARAMETER ::   jp_tair = 6           ! index of 10m air temperature             (Kelvin) 
    59    INTEGER , PARAMETER ::   jp_prec = 7           ! index of total precipitation (rain+snow) (Kg/m2/s) 
    60    INTEGER , PARAMETER ::   jp_snow = 8           ! index of snow (solid prcipitation)       (kg/m2/s) 
    61    INTEGER , PARAMETER ::   jp_tdif = 9           ! index of tau diff associated to HF tau   (N/m2)   at T-point 
    6253    
    63    TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf   ! structure of input fields (file informations, fields read) 
     54   TYPE(MAP_POINTER), ALLOCATABLE, DIMENSION(:) :: nbmap_ptr 
    6455          
    6556   !                                             !!! CORE bulk parameters 
     
    119110      INTEGER, INTENT(in) ::   kt   ! ocean time step 
    120111      !! 
    121       INTEGER  ::   ierror   ! return error code 
    122       INTEGER  ::   ifpr     ! dummy loop indice 
    123       INTEGER  ::   jfld     ! dummy loop arguments 
    124       !! 
    125       CHARACTER(len=100) ::  cn_dir   !   Root directory for location of core files 
    126       TYPE(FLD_N), DIMENSION(jpfld) ::   slf_i     ! array of namelist informations on the fields to read 
    127       TYPE(FLD_N) ::   sn_wndi, sn_wndj, sn_humi, sn_qsr             ! informations about the fields to be read 
    128       TYPE(FLD_N) ::   sn_qlw , sn_tair, sn_prec, sn_snow, sn_tdif   !       -                       - 
    129       NAMELIST/namsbc_core/ cn_dir , ln_2m  , ln_taudif, rn_pfac,           & 
    130          &                  sn_wndi, sn_wndj, sn_humi  , sn_qsr ,           & 
    131          &                  sn_qlw , sn_tair, sn_prec  , sn_snow, sn_tdif 
     112!      NAMELIST/namsbc_core/ cn_dir , ln_2m  , ln_taudif, rn_pfac,           & 
     113!         &                  sn_wndi, sn_wndj, sn_humi  , sn_qsr ,           & 
     114!         &                  sn_qlw , sn_tair, sn_prec  , sn_snow, sn_tdif 
    132115      !!--------------------------------------------------------------------- 
    133116 
     
    135118      IF( kt == nit000 ) THEN                   !  First call kt=nit000  ! 
    136119         !                                      ! ====================== ! 
    137          ! set file information (default values) 
    138          cn_dir = './'       ! directory in which the model is executed 
    139120         ! 
    140          ! (NB: frequency positive => hours, negative => months) 
    141          !            !    file    ! frequency ! variable ! time intep !  clim   ! 'yearly' or ! weights  ! rotation ! 
    142          !            !    name    !  (hours)  !  name    !   (T/F)    !  (T/F)  !  'monthly'  ! filename ! pairs    ! 
    143          sn_wndi = FLD_N( 'uwnd10m',    24     , 'u_10'   ,  .false.   , .false. ,   'yearly'  , ''       , ''       ) 
    144          sn_wndj = FLD_N( 'vwnd10m',    24     , 'v_10'   ,  .false.   , .false. ,   'yearly'  , ''       , ''       ) 
    145          sn_qsr  = FLD_N( 'qsw'    ,    24     , 'qsw'    ,  .false.   , .false. ,   'yearly'  , ''       , ''       ) 
    146          sn_qlw  = FLD_N( 'qlw'    ,    24     , 'qlw'    ,  .false.   , .false. ,   'yearly'  , ''       , ''       ) 
    147          sn_tair = FLD_N( 'tair10m',    24     , 't_10'   ,  .false.   , .false. ,   'yearly'  , ''       , ''       ) 
    148          sn_humi = FLD_N( 'humi10m',    24     , 'q_10'   ,  .false.   , .false. ,   'yearly'  , ''       , ''       ) 
    149          sn_prec = FLD_N( 'precip' ,    -1     , 'precip' ,  .true.    , .false. ,   'yearly'  , ''       , ''       ) 
    150          sn_snow = FLD_N( 'snow'   ,    -1     , 'snow'   ,  .true.    , .false. ,   'yearly'  , ''       , ''       ) 
    151          sn_tdif = FLD_N( 'taudif' ,    24     , 'taudif' ,  .true.    , .false. ,   'yearly'  , ''       , ''       ) 
    152          ! 
    153          REWIND( numnam )                          ! read in namlist namsbc_core 
    154          READ  ( numnam, namsbc_core ) 
    155121         !                                         ! check: do we plan to use ln_dm2dc with non-daily forcing? 
    156          IF( ln_dm2dc .AND. sn_qsr%nfreqh /= 24 )   &  
     122         IF( ln_dm2dc .AND. sf(jp_qsroce)%nfreqh /= 24 )   &  
    157123            &   CALL ctl_stop( 'sbc_blk_core: ln_dm2dc can be activated only with daily short-wave forcing' )  
    158          IF( ln_dm2dc .AND. sn_qsr%ln_tint ) THEN 
     124         IF( ln_dm2dc .AND. sf(jp_qsroce)%ln_tint ) THEN 
    159125            CALL ctl_warn( 'sbc_blk_core: ln_dm2dc is taking care of the temporal interpolation of daily qsr',   & 
    160126                 &         '              ==> We force time interpolation = .false. for qsr' ) 
    161             sn_qsr%ln_tint = .false. 
     127            sf(jp_qsroce)%ln_tint = .false. 
    162128         ENDIF 
    163          !                                         ! store namelist information in an array 
    164          slf_i(jp_wndi) = sn_wndi   ;   slf_i(jp_wndj) = sn_wndj 
    165          slf_i(jp_qsr ) = sn_qsr    ;   slf_i(jp_qlw ) = sn_qlw 
    166          slf_i(jp_tair) = sn_tair   ;   slf_i(jp_humi) = sn_humi 
    167          slf_i(jp_prec) = sn_prec   ;   slf_i(jp_snow) = sn_snow 
    168          slf_i(jp_tdif) = sn_tdif 
    169129         !                  
    170130         lhftau = ln_taudif                        ! do we use HF tau information? 
    171          jfld = jpfld - COUNT( (/.NOT. lhftau/) ) 
    172          ! 
    173          ALLOCATE( sf(jfld), STAT=ierror )         ! set sf structure 
    174          IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_blk_core: unable to allocate sf structure' ) 
    175          DO ifpr= 1, jfld 
    176             ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) ) 
    177             IF( slf_i(ifpr)%ln_tint )   ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) ) 
    178          END DO 
    179          !                                         ! fill sf with slf_i and control print 
    180          CALL fld_fill( sf, slf_i, cn_dir, 'sbc_blk_core', 'flux formulation for ocean surface boundary condition', 'namsbc_core' ) 
    181131         ! 
    182132         sfx(:,:) = 0._wp                          ! salt flux; zero unless ice is present (computed in limsbc(_2).F90) 
    183133         ! 
    184134      ENDIF 
    185  
    186       CALL fld_read( kt, nn_fsbc, sf )             ! input fields provided at the current time-step 
    187  
    188135      !                                            ! compute the surface ocean fluxes using CORE bulk formulea 
    189136      IF( MOD( kt - 1, nn_fsbc ) == 0 )   CALL blk_oce_core( kt, sf, sst_m, ssu_m, ssv_m ) 
     
    192139      IF( MOD( kt - 1, nn_fsbc ) == 0 )   THEN 
    193140         qlw_ice(:,:,1)   = sf(jp_qlw)%fnow(:,:,1)  
    194          qsr_ice(:,:,1)   = sf(jp_qsr)%fnow(:,:,1) 
     141         qsr_ice(:,:,1)   = sf(jp_qsroce)%fnow(:,:,1) 
    195142         tatm_ice(:,:)    = sf(jp_tair)%fnow(:,:,1)          
    196143         qatm_ice(:,:)    = sf(jp_humi)%fnow(:,:,1) 
     
    298245      ! ocean albedo assumed to be constant + modify now Qsr to include the diurnal cycle                    ! Short Wave 
    299246      zztmp = 1. - albo 
    300       IF( ln_dm2dc ) THEN   ;   qsr(:,:) = zztmp * sbc_dcy( sf(jp_qsr)%fnow(:,:,1) ) * tmask(:,:,1) 
    301       ELSE                  ;   qsr(:,:) = zztmp *          sf(jp_qsr)%fnow(:,:,1)   * tmask(:,:,1) 
     247      IF( ln_dm2dc ) THEN   ;   qsr(:,:) = zztmp * sbc_dcy( sf(jp_qsroce)%fnow(:,:,1) ) * tmask(:,:,1) 
     248      ELSE                  ;   qsr(:,:) = zztmp *          sf(jp_qsroce)%fnow(:,:,1)   * tmask(:,:,1) 
    302249      ENDIF 
    303250!CDIR COLLAPSE 
Note: See TracChangeset for help on using the changeset viewer.