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 14388 – NEMO

Changeset 14388


Ignore:
Timestamp:
2021-02-03T17:16:01+01:00 (3 years ago)
Author:
dford
Message:

Modify code for reading in 3D chl data for use in light penetration.

Location:
branches/UKMO/dev_r5518_GO6_package_FOAMv14_readchl/NEMOGCM/NEMO
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GO6_package_FOAMv14_readchl/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90

    r13725 r14388  
    3535   USE stopack 
    3636#if defined key_medusa 
    37    USE trc, ONLY: trn      ! MEDUSA variables 
     37   USE trc, ONLY: trn, chl_for_qsr      ! MEDUSA variables 
    3838   USE par_medusa, ONLY: & ! MEDUSA parameters 
    3939      & jpchn, & 
     
    221221                  ! 
    222222                  CALL fld_read( kt, 1, sf_chl )            ! Read Chl data and provides it at the current time step 
    223 !CDIR NOVERRCHK   ! 
    224                   DO jj = 1, jpj 
    225 !CDIR NOVERRCHK 
    226                      DO ji = 1, jpi 
    227                         zchl    = sf_chl(1)%fnow(ji,jj,1) 
    228                         zCtot   = 40.6  * zchl**0.459 
    229                         zze     = 568.2 * zCtot**(-0.746) 
    230                         IF( zze > 102. ) zze = 200.0 * zCtot**(-0.293) 
    231                         zlogc   = LOG( zchl ) 
    232                         zlogc2  = zlogc * zlogc 
    233                         zlogc3  = zlogc * zlogc * zlogc 
    234                         zCb     = 0.768 + 0.087 * zlogc - 0.179 * zlogc2 - 0.025 * zlogc3 
    235                         zCmax   = 0.299 - 0.289 * zlogc + 0.579 * zlogc2 
    236                         zpsimax = 0.6   - 0.640 * zlogc + 0.021 * zlogc2 + 0.115 * zlogc3 
    237                         zdelpsi = 0.710 + 0.159 * zlogc + 0.021 * zlogc2 
    238                         zCze    = 1.12  * (zchl)**0.803 
    239                         DO jk = 1, nksr + 1 
    240                            zpsi = fsdept(ji,jj,jk) / zze 
    241                            zchl3d(ji,jj,jk) = zCze * ( zCb + zCmax * EXP( -( (zpsi - zpsimax) / zdelpsi )**2 ) ) 
    242                         END DO 
    243                         ! 
    244                       END DO 
    245                    END DO 
    246                      ! 
     223                  DO jk = 1, nksr + 1 
     224                     zchl3d(:,:,jk) = sf_chl(1)%fnow(:,:,jk) 
     225                  ENDDO 
     226                  chl_for_qsr(:,:,:) = zchl3d(:,:,:) 
     227                  ! 
    247228               ELSE IF( nn_chldta == 3 ) THEN 
    248229                  ! 
     
    259240                  DO jk = 1, nksr + 1 
    260241                     zchl3d(:,:,jk) = 0.05 
     242                  ENDDO 
     243                  CALL fld_read( kt, 1, sf_chl )            ! Read Chl data and provides it at the current time step 
     244                  ! 
     245                  DO jk = 1, nksr + 1 
     246                     chl_for_qsr(:,:,jk) = sf_chl(1)%fnow(:,:,jk) 
    261247                  ENDDO 
    262248               ENDIF 
     
    559545                  CALL ctl_stop( 'tra_qsr_init: unable to allocate sf_chl structure' )   ;   RETURN 
    560546               ENDIF 
    561                ALLOCATE( sf_chl(1)%fnow(jpi,jpj,1)   ) 
    562                IF( sn_chl%ln_tint )ALLOCATE( sf_chl(1)%fdta(jpi,jpj,1,2) ) 
    563                !                                        ! fill sf_chl with sn_chl and control print 
     547               IF( nn_chldta == 1 ) THEN 
     548                  ALLOCATE( sf_chl(1)%fnow(jpi,jpj,1)   ) 
     549                  IF( sn_chl%ln_tint )ALLOCATE( sf_chl(1)%fdta(jpi,jpj,1,2) ) 
     550                  !                                        ! fill sf_chl with sn_chl and control print 
     551               ELSE IF( nn_chldta == 2 ) THEN 
     552                  ALLOCATE( sf_chl(1)%fnow(jpi,jpj,jpk)   ) 
     553                  IF( sn_chl%ln_tint )ALLOCATE( sf_chl(1)%fdta(jpi,jpj,jpk,2) ) 
     554                  !    
     555               ENDIF 
    564556               CALL fld_fill( sf_chl, (/ sn_chl /), cn_dir, 'tra_qsr_init',   & 
    565557                  &                                         'Solar penetration function of read chlorophyll', 'namtra_qsr' ) 
     
    568560               IF(lwp) WRITE(numout,*) 
    569561               IF(lwp) WRITE(numout,*) '        Chlorophyll will be taken from model at each time step' 
    570             ELSE                                !* constant Chl : compute once for all the distribution of light (etot3) 
     562            ELSE       
     563               ALLOCATE( sf_chl(1), STAT=ierror ) 
     564               IF( ierror > 0 ) THEN 
     565                  CALL ctl_stop( 'tra_qsr_init: unable to allocate sf_chl structure' )   ;   RETURN 
     566               ENDIF 
     567               ALLOCATE( sf_chl(1)%fnow(jpi,jpj,jpk)   ) 
     568               IF( sn_chl%ln_tint )ALLOCATE( sf_chl(1)%fdta(jpi,jpj,jpk,2) ) 
     569               CALL fld_fill( sf_chl, (/ sn_chl /), cn_dir, 'tra_qsr_init',   & 
     570                  &                                         'Solar penetration function of read chlorophyll', 'namtra_qsr' ) 
    571571               IF(lwp) WRITE(numout,*) 
    572572               IF(lwp) WRITE(numout,*) '        Constant Chlorophyll concentration = 0.05' 
  • branches/UKMO/dev_r5518_GO6_package_FOAMv14_readchl/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcopt_medusa.F90

    r13725 r14388  
    126126            DO jj = 1, jpj 
    127127               DO ji = 1, jpi 
    128                   totchl = trn(ji,jj,jk,jpchn) + trn(ji,jj,jk,jpchd) 
     128                  !totchl = trn(ji,jj,jk,jpchn) + trn(ji,jj,jk,jpchd) 
     129                  totchl = chl_for_qsr(ji,jj,jk) 
    129130                  totchl = MIN( 10. , MAX( 0.05, totchl ) ) 
    130131                  irgb = NINT( 41 + 20.* LOG10( totchl ) + 1.e-15 ) 
  • branches/UKMO/dev_r5518_GO6_package_FOAMv14_readchl/NEMOGCM/NEMO/TOP_SRC/trc.F90

    r13725 r14388  
    2020 
    2121   PUBLIC   trc_alloc   ! called by nemogcm.F90 
     22 
     23   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)           ::  chl_for_qsr 
    2224 
    2325   !! parameters for the control of passive tracers 
     
    276278         &      cycletot(6), cycletot2(6)                                             ,       & 
    277279# endif 
    278          &      ln_trc_ini(jptra)     , ln_trc_wri(jptra)     , qsr_mean(jpi,jpj)     ,  STAT = trc_alloc  )   
     280         &      ln_trc_ini(jptra)     , ln_trc_wri(jptra)     , qsr_mean(jpi,jpj), chl_for_qsr(jpi,jpj,jpk)     ,  STAT = trc_alloc  )   
    279281 
    280282      IF( trc_alloc /= 0 )   CALL ctl_warn('trc_alloc: failed to allocate arrays') 
Note: See TracChangeset for help on using the changeset viewer.