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

Changeset 15358


Ignore:
Timestamp:
2021-10-13T10:35:58+02:00 (10 months ago)
Author:
hadjt
Message:

DIA/diaregmean.F90

Region mean namelist switch added to allow area weighted region means.

Location:
NEMO/branches/UKMO/NEMO_4.0.4_CO9_shelf_climate/src/OCE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.4_CO9_shelf_climate/src/OCE/DIA/diaregmean.F90

    r15357 r15358  
    4141   LOGICAL :: ln_diaregmean_pea         ! region mean calculation including pea terms 
    4242   INTEGER :: nn_diaregmean_nhourlymean ! region mean number of hours in mean (normally 1., <0 = instantanous (slower)) 
     43   LOGICAL :: ln_diaregmean_areawgt     ! Area weight region mean and region std 
    4344 
    4445 
     
    5657   REAL(wp),  ALLOCATABLE,   DIMENSION(:,:,:) ::   tmp_field_AR5_mat !: temporary region_mask 
    5758   REAL(wp),  ALLOCATABLE,   DIMENSION(:,:,:) ::   tmp_field_SBC_mat !: temporary region_mask 
     59   REAL(wp),  ALLOCATABLE,   DIMENSION(:,:)   ::   region_area_mat !: temporary region_mask 
    5860   INTEGER  ::   tmp_field_cnt                                   ! tmp_field_cnt integer 
    5961   !!---------------------------------------------------------------------- 
     
    100102#if defined key_fabm 
    101103      NAMELIST/nam_diaregmean/ ln_diaregmean,nn_regions_output,ln_diaregmean_ascii,ln_diaregmean_bin,ln_diaregmean_nc,& 
    102         & ln_diaregmean_karamld, ln_diaregmean_pea,ln_diaregmean_diaar5,ln_diaregmean_diasbc,ln_diaregmean_bgc,nn_diaregmean_nhourlymean 
     104        & ln_diaregmean_karamld, ln_diaregmean_pea,ln_diaregmean_diaar5,ln_diaregmean_diasbc,ln_diaregmean_bgc,& 
     105        & nn_diaregmean_nhourlymean,ln_diaregmean_areawgt 
    103106#else 
    104107      NAMELIST/nam_diaregmean/ ln_diaregmean,nn_regions_output,ln_diaregmean_ascii,ln_diaregmean_bin,ln_diaregmean_nc,& 
    105         & ln_diaregmean_karamld, ln_diaregmean_pea,ln_diaregmean_diaar5,ln_diaregmean_diasbc,nn_diaregmean_nhourlymean 
     108        & ln_diaregmean_karamld, ln_diaregmean_pea,ln_diaregmean_diaar5,ln_diaregmean_diasbc,& 
     109        & nn_diaregmean_nhourlymean,ln_diaregmean_areawgt 
    106110#endif 
    107111       
     
    133137          WRITE(numout,*) 'Switch for regmean Surface forcing terms (T) or not (F)  ln_diaregmean_diasbc  = ', ln_diaregmean_diasbc 
    134138          WRITE(numout,*) 'Switch for regmean BioGeoChemistry terms (T) or not (F)  ln_diaregmean_bgc  = ', ln_diaregmean_bgc 
     139          WRITE(numout,*) 'Switch for regmean area weighting mean, std and cnt (T) or not (F)  ln_diaregmean_areawgt  = ', ln_diaregmean_areawgt 
     140          WRITE(numout,*) 'Integer for regmean number of hours averaged before iom_put ' 
     141          WRITE(numout,*) '           (<0 = instanteous, default = 1)  nn_diaregmean_nhourlymean  = ', nn_diaregmean_nhourlymean 
    135142      ENDIF 
    136143       
     
    156163      ENDIF 
    157164 
     165 
     166      ALLOCATE( region_area_mat(jpi,jpj),  STAT= ierr ) !SS/NB/DT/ZA/VA T/S, SSH, MLD, PEA, PEAT, PEAS 
     167          IF( ierr /= 0 )   CALL ctl_stop( 'region_area_mat: failed to allocate tmp_field_mat array' ) 
     168      region_area_mat(:,:) = 1. 
     169 
     170 
     171      if ( ln_diaregmean_areawgt ) THEN 
     172          region_area_mat(:,:) = e1t(:,:)*e2t(:,:) 
     173      ENDIF 
    158174 
    159175      tmp_field_cnt = 0 
     
    10391055                    IF ( tmask(ji,jj,1) == 1.0_wp ) THEN 
    10401056                        ind = internal_region_mask(ji,jj)+1 
    1041                         tot_mat(ind) = tot_mat(ind) + (internal_infield(ji,jj)) 
    1042                         ssq_mat(ind) = ssq_mat(ind) + ( internal_infield(ji,jj) *  internal_infield(ji,jj)) 
    1043                         cnt_mat(ind) = cnt_mat(ind) + 1. 
     1057                        !tot_mat(ind) = tot_mat(ind) + (internal_infield(ji,jj)) 
     1058                        !ssq_mat(ind) = ssq_mat(ind) + ( internal_infield(ji,jj) *  internal_infield(ji,jj)) 
     1059                        !cnt_mat(ind) = cnt_mat(ind) + 1. 
     1060                        ! Area Weighted values - region_area_mat == 1. or area depending on ln_diaregmean_areawgt 
     1061                        tot_mat(ind) = tot_mat(ind) + (region_area_mat(ji,jj)*internal_infield(ji,jj)) 
     1062                        ssq_mat(ind) = ssq_mat(ind) + (region_area_mat(ji,jj)*(internal_infield(ji,jj) * internal_infield(ji,jj))) 
     1063                        cnt_mat(ind) = cnt_mat(ind) + (region_area_mat(ji,jj)*1.) 
     1064 
     1065 
    10441066 
    10451067                        !min_mat(ind) = min(min_mat(ind),internal_infield(ji,jj)) 
  • NEMO/branches/UKMO/NEMO_4.0.4_CO9_shelf_climate/src/OCE/IOM/iom.F90

    r15357 r15358  
    138138      LOGICAL :: ln_diaregmean_diasbc  ! region mean calculation including Surface BC 
    139139      INTEGER :: nn_diaregmean_nhourlymean ! region mean number of hours in mean (normally 1., <0 = instantanous (slower)) 
     140      LOGICAL :: ln_diaregmean_areawgt  ! Area weight region mean and region std 
     141 
    140142     
    141143#if defined key_fabm 
     
    167169#if defined key_fabm 
    168170      NAMELIST/nam_diaregmean/ ln_diaregmean,nn_regions_output,ln_diaregmean_ascii,ln_diaregmean_bin,ln_diaregmean_nc,& 
    169         & ln_diaregmean_karamld, ln_diaregmean_pea,ln_diaregmean_diaar5,ln_diaregmean_diasbc,ln_diaregmean_bgc,nn_diaregmean_nhourlymean 
     171        & ln_diaregmean_karamld, ln_diaregmean_pea,ln_diaregmean_diaar5,ln_diaregmean_diasbc,ln_diaregmean_bgc,& 
     172        & nn_diaregmean_nhourlymean,ln_diaregmean_areawgt 
    170173#else 
    171174      NAMELIST/nam_diaregmean/ ln_diaregmean,nn_regions_output,ln_diaregmean_ascii,ln_diaregmean_bin,ln_diaregmean_nc,& 
    172         & ln_diaregmean_karamld, ln_diaregmean_pea,ln_diaregmean_diaar5,ln_diaregmean_diasbc,nn_diaregmean_nhourlymean 
     175        & ln_diaregmean_karamld, ln_diaregmean_pea,ln_diaregmean_diaar5,ln_diaregmean_diasbc,& 
     176        & nn_diaregmean_nhourlymean,ln_diaregmean_areawgt 
    173177#endif 
    174178       
Note: See TracChangeset for help on using the changeset viewer.