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 13710 for NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves/tests/STATION_ASF – NEMO

Ignore:
Timestamp:
2020-11-02T10:56:42+01:00 (4 years ago)
Author:
emanuelaclementi
Message:

branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves: merge with trunk@13708, see #2155 and #2339

Location:
NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves
Files:
14 edited
3 copied

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
         5^/vendors/AGRIF/dev_r12970_AGRIF_CMEMS      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
        88 
        99# SETTE 
        10 ^/utils/CI/sette@HEAD         sette 
         10^/utils/CI/sette@13559        sette 
  • NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves/tests/STATION_ASF/EXPREF/file_def_nemo-oce.xml

    r11930 r13710  
    2828      <field field_ref="empmr"        name="empmr" /> 
    2929      <!-- --> 
    30       <field field_ref="taum"         name="taum"     /> 
    31       <field field_ref="wspd"         name="windsp"   /> 
     30      <field field_ref="taum"         name="taum"   /> 
     31      <field field_ref="wspd"         name="windsp" /> 
     32      <!-- --> 
     33      <field field_ref="Cd_oce"       name="Cd_oce" /> 
     34      <field field_ref="Ce_oce"       name="Ce_oce" /> 
     35      <field field_ref="Ch_oce"       name="Ch_oce" /> 
     36      <field field_ref="theta_zt"     name="theta_zt" /> 
     37      <field field_ref="q_zt"         name="q_zt" /> 
     38      <field field_ref="theta_zu"     name="theta_zu" /> 
     39      <field field_ref="q_zu"         name="q_zu" /> 
     40      <field field_ref="ssq"          name="ssq" /> 
     41      <field field_ref="wspd_blk"     name="wspd_blk" />       
    3242    </file> 
    3343 
  • NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves/tests/STATION_ASF/EXPREF/launch_sasf.sh

    r12615 r13710  
    11#!/bin/bash 
    22 
    3 # NEMO directory where to fetch compiled STATION_ASF nemo.exe + setup: 
    4 NEMO_DIR=`pwd | sed -e "s|/tests/STATION_ASF/EXPREF||g"` 
     3################################################################ 
     4# 
     5# Script to launch a set of STATION_ASF simulations 
     6# 
     7# L. Brodeau, 2020 
     8# 
     9################################################################ 
    510 
    6 echo "Using NEMO_DIR=${NEMO_DIR}" 
    7  
    8 # what directory inside "tests" actually contains the compiled test-case? 
     11# What directory inside "tests" actually contains the compiled "nemo.exe" for STATION_ASF ? 
    912TC_DIR="STATION_ASF2" 
    1013 
    11 # => so the executable to use is: 
    12 NEMO_EXE="${NEMO_DIR}/tests/${TC_DIR}/BLD/bin/nemo.exe" 
     14expdir=`basename ${PWD}`; # we expect "EXPREF" or "EXP00" normally... 
     15 
     16# NEMOGCM root directory: 
     17NEMO_ROOT_DIR=`pwd | sed -e "s|/tests/STATION_ASF/${expdir}||g"` 
     18 
     19# NEMOGCM root directory where to fetch compiled STATION_ASF nemo.exe: 
     20SASF_WRK_DIR="${NEMO_ROOT_DIR}/tests/${TC_DIR}" 
    1321 
    1422# Directory where to run the simulation: 
    15 WORK_DIR="${HOME}/tmp/STATION_ASF" 
     23PROD_DIR="${HOME}/tmp/STATION_ASF" 
    1624 
    1725 
    18 # FORC_DIR => Directory containing sea-surface + atmospheric forcings 
    19 #             (get it there https://drive.google.com/file/d/1MxNvjhRHmMrL54y6RX7WIaM9-LGl--ZP/): 
    20 if [ `hostname` = "merlat"        ]; then 
    21     FORC_DIR="/MEDIA/data/STATION_ASF/input_data_STATION_ASF_2016-2018" 
    22 elif [ `hostname` = "luitel"        ]; then 
    23     FORC_DIR="/data/gcm_setup/STATION_ASF/input_data_STATION_ASF_2016-2018" 
    24 elif [ `hostname` = "ige-meom-cal1" ]; then 
    25     FORC_DIR="/mnt/meom/workdir/brodeau/STATION_ASF/input_data_STATION_ASF_2016-2018" 
    26 elif [ `hostname` = "salvelinus" ]; then 
    27     FORC_DIR="/opt/data/STATION_ASF/input_data_STATION_ASF_2016-2018" 
    28 else 
    29     echo "Boo!"; exit 
    30 fi 
    31 #====================== 
    32 mkdir -p ${WORK_DIR} 
     26####### End of normal user configurable section ####### 
     27 
     28#================================================================================ 
     29 
     30SASF_REF_DIR="${NEMO_ROOT_DIR}/tests/STATION_ASF" 
     31if [ ! -d ${SASF_REF_DIR} ]; then echo " Mhhh, no EXPREF directory ${SASF_REF_DIR} !"; exit; fi 
     32 
     33# NEMO executable to use is: 
     34NEMO_EXE="${SASF_WRK_DIR}/BLD/bin/nemo.exe" 
     35if [ ! -f ${NEMO_EXE} ]; then echo " Mhhh, no compiled 'nemo.exe' found into `dirname ${NEMO_EXE}` !"; exit; fi 
     36 
     37DATA_IN_DIR="${SASF_REF_DIR}/input_data" ; # Directory containing sea-surface + atmospheric input data 
     38if [ ! -d ${DATA_IN_DIR} ]; then echo "PROBLEM!!! => did not find directory 'input_data' with input forcing..."; exit; fi 
     39 
     40SASF_EXPREF=${SASF_REF_DIR}/${expdir}  ; # STATION_ASF EXPREF directory from which to use namelists and XIOS xml files... 
     41if [ ! -d ${SASF_EXPREF} ]; then echo " Mhhh, no ${expdir} directory ${SASF_EXPREF} !"; exit; fi 
    3342 
    3443 
    35 if [ ! -f ${NEMO_EXE} ]; then echo " Mhhh, no compiled nemo.exe found into ${NEMO_DIR}/tests/STATION_ASF/BLD/bin !"; exit; fi 
     44echo "###########################################################" 
     45echo "#        S T A T I O N   A i r  -  S e a   F l u x        #" 
     46echo "###########################################################" 
     47echo 
     48echo "  * NEMO reference root directory is: ${NEMO_ROOT_DIR}" 
     49echo "  * STATION_ASF work directory is: ${SASF_WRK_DIR}" 
     50echo "       ==> NEMO EXE to use: ${NEMO_EXE}" 
     51echo 
     52echo "  * Input forcing data into: ${DATA_IN_DIR}" 
     53echo "  * Production will be done into: ${PROD_DIR}" 
     54echo "  * Directory in which namelists and xml files are fetched:" 
     55echo "       ==> ${SASF_EXPREF}" 
     56echo 
    3657 
    37 NEMO_EXPREF="${NEMO_DIR}/tests/STATION_ASF/EXPREF" 
    38 if [ ! -d ${NEMO_EXPREF} ]; then echo " Mhhh, no EXPREF directory ${NEMO_EXPREF} !"; exit; fi 
     58mkdir -p ${PROD_DIR} 
    3959 
    40 rsync -avP ${NEMO_EXE}          ${WORK_DIR}/ 
     60rsync -avP ${NEMO_EXE}          ${PROD_DIR}/ 
    4161 
    4262for ff in "context_nemo.xml" "domain_def_nemo.xml" "field_def_nemo-oce.xml" "file_def_nemo-oce.xml" "grid_def_nemo.xml" "iodef.xml" "namelist_ref"; do 
    43     if [ ! -f ${NEMO_EXPREF}/${ff} ]; then echo " Mhhh, ${ff} not found into ${NEMO_EXPREF} !"; exit; fi 
    44     rsync -avPL ${NEMO_EXPREF}/${ff} ${WORK_DIR}/ 
     63    if [ ! -f ${SASF_EXPREF}/${ff} ]; then echo " Mhhh, ${ff} not found into ${SASF_EXPREF} !"; exit; fi 
     64    rsync -avPL ${SASF_EXPREF}/${ff} ${PROD_DIR}/ 
    4565done 
    4666 
    4767# Copy forcing to work directory: 
    48 rsync -avP ${FORC_DIR}/Station_PAPA_50N-145W*.nc ${WORK_DIR}/ 
     68rsync -avP ${DATA_IN_DIR}/Station_PAPA_50N-145W*.nc ${PROD_DIR}/ 
    4969 
    5070for CASE in "ECMWF" "COARE3p6" "NCAR" "ECMWF-noskin" "COARE3p6-noskin"; do 
     
    5878    scase=`echo "${CASE}" | tr '[:upper:]' '[:lower:]'` 
    5979 
    60     rm -f ${WORK_DIR}/namelist_cfg 
    61     rsync -avPL ${NEMO_EXPREF}/namelist_${scase}_cfg ${WORK_DIR}/namelist_cfg 
     80    rm -f ${PROD_DIR}/namelist_cfg 
     81    rsync -avPL ${SASF_EXPREF}/namelist_${scase}_cfg ${PROD_DIR}/namelist_cfg 
    6282 
    63     cd ${WORK_DIR}/ 
     83    cd ${PROD_DIR}/ 
    6484    echo 
    6585    echo "Launching NEMO !" 
  • NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves/tests/STATION_ASF/EXPREF/namelist_coare3p6-noskin_cfg

    r12615 r13710  
    2929   cn_exp      =  'STATION_ASF-COARE3p6-noskin'  !  experience name 
    3030   nn_it000    =    1   !  first time step 
    31    nn_itend    =    26280   !  last  time step (std 5840) 
    32    nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
     31!!!   nn_itend    =    26304   !  last  time step => 3 years (including 1 leap!) at dt=3600s 
     32!!!   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
     33   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s 
     34   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
    3335   nn_time0    =       0   !  initial time of day in hhmm 
    34    nn_leapy    =       0   !  Leap year calendar (1) or not (0) 
     36   nn_leapy    =       1   !  Leap year calendar (1) or not (0) 
    3537   ln_rstart   = .false.   !  start from rest (F) or from a restart file (T) 
    3638      ln_1st_euler = .false.  !  =T force a start with forward time step (ln_rstart=T) 
     
    4547   nn_istate   =       0   !  output the initial state (1) or not (0) 
    4648   ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F) 
    47    nn_stock    =    26280   ! 1year @ dt=3600 s / frequency of creation of a restart file (modulo referenced to 1) 
    48    nn_write    =    26280   ! 1year @ dt=3600 s / frequency of write in the output file   (modulo referenced to nn_it000) 
     49   !! 
     50!!!   nn_stock    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of creation of a restart file (modulo referenced to 1) 
     51!!!   nn_write    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000) 
     52   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1) 
     53   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000) 
     54   !! 
    4955   ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%) 
    5056   ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard 
     
    195201!!                                                                    !! 
    196202!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    197 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    198 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     203!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     204!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    199205!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    200206!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    244250!!                                                                    !! 
    245251!!   namtrd       dynamics and/or tracer trends                         (default: OFF) 
    246 !!   namptr       Poleward Transport Diagnostics                        (default: OFF) 
    247252!!   namhsb       Heat and salt budgets                                 (default: OFF) 
    248253!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
  • NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves/tests/STATION_ASF/EXPREF/namelist_coare3p6_cfg

    r12615 r13710  
    2929   cn_exp      =  'STATION_ASF-COARE3p6'  !  experience name 
    3030   nn_it000    =    1   !  first time step 
    31    nn_itend    =    26280   !  last  time step (std 5840) 
    32    nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
     31!!!   nn_itend    =    26304   !  last  time step => 3 years (including 1 leap!) at dt=3600s 
     32!!!   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
     33   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s 
     34   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
    3335   nn_time0    =       0   !  initial time of day in hhmm 
    34    nn_leapy    =       0   !  Leap year calendar (1) or not (0) 
     36   nn_leapy    =       1   !  Leap year calendar (1) or not (0) 
    3537   ln_rstart   = .false.   !  start from rest (F) or from a restart file (T) 
    3638      ln_1st_euler = .false.  !  =T force a start with forward time step (ln_rstart=T) 
     
    4547   nn_istate   =       0   !  output the initial state (1) or not (0) 
    4648   ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F) 
    47    nn_stock    =    26280   ! 1year @ dt=3600 s / frequency of creation of a restart file (modulo referenced to 1) 
    48    nn_write    =    26280   ! 1year @ dt=3600 s / frequency of write in the output file   (modulo referenced to nn_it000) 
     49   !! 
     50!!!   nn_stock    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of creation of a restart file (modulo referenced to 1) 
     51!!!   nn_write    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000) 
     52   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1) 
     53   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000) 
     54   !! 
    4955   ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%) 
    5056   ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard 
     
    134140      ln_humi_rlh = .true.  !  humidity specified below in "sn_humi" is relative humidity       [%]   if .true. 
    135141   ! 
    136    cn_dir      = './'      !  root directory for the bulk data location 
     142   cn_dir = './'  !  root directory for the bulk data location 
    137143   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________! 
    138144   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask ! 
     
    163169      ln_read_frq = .false.   !  specify whether we must read frq or not 
    164170 
    165    cn_dir      = './'      !  root directory for the ocean data location 
     171   cn_dir      = './'     !  root directory for the ocean data location 
    166172   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________! 
    167173   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask ! 
     
    195201!!                                                                    !! 
    196202!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    197 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    198 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     203!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     204!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    199205!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    200206!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    215221&nameos        !   ocean Equation Of Seawater                           (default: NO selection) 
    216222!----------------------------------------------------------------------- 
    217    ln_eos80    = .true.         !  = Use EOS80 
     223   ln_eos80    = .true.          !  = Use EOS80 
    218224/ 
    219225!!====================================================================== 
     
    244250!!                                                                    !! 
    245251!!   namtrd       dynamics and/or tracer trends                         (default: OFF) 
    246 !!   namptr       Poleward Transport Diagnostics                        (default: OFF) 
    247252!!   namhsb       Heat and salt budgets                                 (default: OFF) 
    248253!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
  • NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves/tests/STATION_ASF/EXPREF/namelist_ecmwf-noskin_cfg

    r12615 r13710  
    2929   cn_exp      =  'STATION_ASF-ECMWF-noskin'  !  experience name 
    3030   nn_it000    =    1   !  first time step 
    31    nn_itend    =    26280   !  last  time step (std 5840) 
    32    nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
     31!!!   nn_itend    =    26304   !  last  time step => 3 years (including 1 leap!) at dt=3600s 
     32!!!   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
     33   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s 
     34   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
    3335   nn_time0    =       0   !  initial time of day in hhmm 
    34    nn_leapy    =       0   !  Leap year calendar (1) or not (0) 
     36   nn_leapy    =       1   !  Leap year calendar (1) or not (0) 
    3537   ln_rstart   = .false.   !  start from rest (F) or from a restart file (T) 
    3638      ln_1st_euler = .false.  !  =T force a start with forward time step (ln_rstart=T) 
     
    4547   nn_istate   =       0   !  output the initial state (1) or not (0) 
    4648   ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F) 
    47    nn_stock    =    26280   ! 1year @ dt=3600 s / frequency of creation of a restart file (modulo referenced to 1) 
    48    nn_write    =    26280   ! 1year @ dt=3600 s / frequency of write in the output file   (modulo referenced to nn_it000) 
     49   !! 
     50!!!   nn_stock    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of creation of a restart file (modulo referenced to 1) 
     51!!!   nn_write    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000) 
     52   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1) 
     53   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000) 
     54   !! 
    4955   ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%) 
    5056   ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard 
     
    195201!!                                                                    !! 
    196202!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    197 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    198 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     203!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     204!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    199205!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    200206!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    244250!!                                                                    !! 
    245251!!   namtrd       dynamics and/or tracer trends                         (default: OFF) 
    246 !!   namptr       Poleward Transport Diagnostics                        (default: OFF) 
    247252!!   namhsb       Heat and salt budgets                                 (default: OFF) 
    248253!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
  • NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves/tests/STATION_ASF/EXPREF/namelist_ecmwf_cfg

    r12615 r13710  
    2929   cn_exp      =  'STATION_ASF-ECMWF'  !  experience name 
    3030   nn_it000    =    1   !  first time step 
    31    nn_itend    =    26280   !  last  time step (std 5840) 
    32    nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
     31!!!   nn_itend    =    26304   !  last  time step => 3 years (including 1 leap!) at dt=3600s 
     32!!!   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
     33   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s 
     34   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
    3335   nn_time0    =       0   !  initial time of day in hhmm 
    34    nn_leapy    =       0   !  Leap year calendar (1) or not (0) 
     36   nn_leapy    =       1   !  Leap year calendar (1) or not (0) 
    3537   ln_rstart   = .false.   !  start from rest (F) or from a restart file (T) 
    3638      ln_1st_euler = .false.  !  =T force a start with forward time step (ln_rstart=T) 
     
    4547   nn_istate   =       0   !  output the initial state (1) or not (0) 
    4648   ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F) 
    47    nn_stock    =    26280   ! 1year @ dt=3600 s / frequency of creation of a restart file (modulo referenced to 1) 
    48    nn_write    =    26280   ! 1year @ dt=3600 s / frequency of write in the output file   (modulo referenced to nn_it000) 
     49   !! 
     50!!!   nn_stock    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of creation of a restart file (modulo referenced to 1) 
     51!!!   nn_write    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000) 
     52   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1) 
     53   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000) 
     54   !! 
    4955   ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%) 
    5056   ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard 
     
    134140      ln_humi_rlh = .true.  !  humidity specified below in "sn_humi" is relative humidity       [%]   if .true. 
    135141   ! 
    136    cn_dir      = './'      !  root directory for the bulk data location 
     142   cn_dir = './'  !  root directory for the bulk data location 
    137143   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________! 
    138144   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask ! 
     
    163169      ln_read_frq = .false.   !  specify whether we must read frq or not 
    164170 
    165    cn_dir      = './'      !  root directory for the ocean data location 
     171   cn_dir      = './'     !  root directory for the ocean data location 
    166172   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________! 
    167173   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask ! 
     
    195201!!                                                                    !! 
    196202!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    197 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    198 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     203!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     204!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    199205!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    200206!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    215221&nameos        !   ocean Equation Of Seawater                           (default: NO selection) 
    216222!----------------------------------------------------------------------- 
    217    ln_eos80    = .true.         !  = Use EOS80 
     223   ln_eos80    = .true.          !  = Use EOS80 
    218224/ 
    219225!!====================================================================== 
     
    244250!!                                                                    !! 
    245251!!   namtrd       dynamics and/or tracer trends                         (default: OFF) 
    246 !!   namptr       Poleward Transport Diagnostics                        (default: OFF) 
    247252!!   namhsb       Heat and salt budgets                                 (default: OFF) 
    248253!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
  • NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves/tests/STATION_ASF/EXPREF/namelist_ncar_cfg

    r12615 r13710  
    2929   cn_exp      =  'STATION_ASF-NCAR'  !  experience name 
    3030   nn_it000    =    1   !  first time step 
    31    nn_itend    =    26280   !  last  time step (std 5840) 
    32    nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
     31!!!   nn_itend    =    26304   !  last  time step => 3 years (including 1 leap!) at dt=3600s 
     32!!!   nn_date0    =    20160101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
     33   nn_itend    =    8760   !  last  time step => 3 years (including 1 leap!) at dt=3600s 
     34   nn_date0    = 20180101  !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
    3335   nn_time0    =       0   !  initial time of day in hhmm 
    34    nn_leapy    =       0   !  Leap year calendar (1) or not (0) 
     36   nn_leapy    =       1   !  Leap year calendar (1) or not (0) 
    3537   ln_rstart   = .false.   !  start from rest (F) or from a restart file (T) 
    3638      ln_1st_euler = .false.  !  =T force a start with forward time step (ln_rstart=T) 
     
    4547   nn_istate   =       0   !  output the initial state (1) or not (0) 
    4648   ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F) 
    47    nn_stock    =    26280   ! 1year @ dt=3600 s / frequency of creation of a restart file (modulo referenced to 1) 
    48    nn_write    =    26280   ! 1year @ dt=3600 s / frequency of write in the output file   (modulo referenced to nn_it000) 
     49   !! 
     50!!!   nn_stock    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of creation of a restart file (modulo referenced to 1) 
     51!!!   nn_write    =    26304   ! 3 years (including 1 leap!) at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000) 
     52   nn_stock    =    8760   ! 1 year at dt=3600s / frequency of creation of a restart file (modulo referenced to 1) 
     53   nn_write    =    8760   ! 1 year at dt=3600s / frequency of write in the output file   (modulo referenced to nn_it000) 
     54   !! 
    4955   ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%) 
    5056   ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard 
     
    134140      ln_humi_rlh = .true.  !  humidity specified below in "sn_humi" is relative humidity       [%]   if .true. 
    135141   ! 
    136    cn_dir      = './'      !  root directory for the bulk data location 
     142   cn_dir = './'  !  root directory for the bulk data location 
    137143   !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________! 
    138144   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask ! 
     
    163169      ln_read_frq = .false.   !  specify whether we must read frq or not 
    164170 
    165    cn_dir      = './'      !  root directory for the ocean data location 
     171   cn_dir      = './'     !  root directory for the ocean data location 
    166172   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________! 
    167173   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask ! 
     
    195201!!                                                                    !! 
    196202!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    197 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    198 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     203!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     204!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    199205!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    200206!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    215221&nameos        !   ocean Equation Of Seawater                           (default: NO selection) 
    216222!----------------------------------------------------------------------- 
    217    ln_eos80    = .true.         !  = Use EOS80 
     223   ln_eos80    = .true.          !  = Use EOS80 
    218224/ 
    219225!!====================================================================== 
     
    244250!!                                                                    !! 
    245251!!   namtrd       dynamics and/or tracer trends                         (default: OFF) 
    246 !!   namptr       Poleward Transport Diagnostics                        (default: OFF) 
    247252!!   namhsb       Heat and salt budgets                                 (default: OFF) 
    248253!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
  • NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves/tests/STATION_ASF/EXPREF/plot_station_asf.py

    r12629 r13710  
    1 #!/usr/bin/env python 
     1#!/usr/bin/env python3 
    22# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- 
    33 
    4 # Post-diagnostic of STATION_ASF /  L. Brodeau, 2019 
     4# Post-diagnostic of STATION_ASF /  L. Brodeau, 2020 
    55 
    66import sys 
    77from os import path as path 
    8 #from string import replace 
    98import math 
    109import numpy as nmp 
    11 #import scipy.signal as signal 
    1210from netCDF4 import Dataset 
    1311import matplotlib as mpl 
     
    1513import matplotlib.pyplot as plt 
    1614import matplotlib.dates as mdates 
    17 #from string import find 
    18 #import warnings 
    19 #warnings.filterwarnings("ignore") 
    20 #import time 
    21  
    22 #import barakuda_plot as bp 
    23 #import barakuda_tool as bt 
    24  
    25 reload(sys) 
    26 sys.setdefaultencoding('utf8') 
    27  
    28 cy1     = '2016' ; # First year 
     15 
     16cy1     = '2018' ; # First year 
    2917cy2     = '2018' ; # Last year 
    30  
    31 jt0 = 0 
    32 jt0 = 17519 
    33  
    3418 
    3519dir_figs='.' 
     
    7256narg = len(sys.argv) 
    7357if narg != 2: 
    74     print 'Usage: '+sys.argv[0]+' <DIR_OUT_SASF>'; sys.exit(0) 
     58    print('Usage: '+sys.argv[0]+' <DIR_OUT_SASF>'); sys.exit(0) 
    7559cdir_data = sys.argv[1] 
    7660 
     
    8266def chck4f(cf): 
    8367    cmesg = 'ERROR: File '+cf+' does not exist !!!' 
    84     if not path.exists(cf): print cmesg ; sys.exit(0) 
     68    if not path.exists(cf): print(cmesg); sys.exit(0) 
    8569 
    8670###cf_in = nmp.empty((), dtype="S10") 
     
    10488# Getting time array from the first file: 
    10589id_in = Dataset(cf_in[0]) 
    106 vt = id_in.variables['time_counter'][jt0:] 
     90vt = id_in.variables['time_counter'][:] 
    10791cunit_t = id_in.variables['time_counter'].units ; print(' "time_counter" is in "'+cunit_t+'"') 
    10892id_in.close() 
     
    138122            if ctest == 'skin':   id_in = Dataset(cf_in[ja]) 
    139123            if ctest == 'noskin': id_in = Dataset(cf_in_ns[ja]) 
    140             xF[:,ja] = id_in.variables[L_VNEM[jv]][jt0:,1,1] # only the center point of the 3x3 spatial domain! 
     124            xF[:,ja] = id_in.variables[L_VNEM[jv]][:,1,1] # only the center point of the 3x3 spatial domain! 
    141125            if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name 
    142126            id_in.close() 
     
    180164                rmlt = 10.**(int(romagn)) / 2. 
    181165                yrng = math.copysign( math.ceil(abs(rmax)/rmlt)*rmlt , rmax) 
    182                 #print 'yrng = ', yrng ;  #sys.exit(0) 
    183166 
    184167                fig = plt.figure(num = 10+jv, figsize=size_fig, facecolor='w', edgecolor='k') 
     
    211194    for ja in range(nb_algos-1): 
    212195        id_in = Dataset(cf_in[ja]) 
    213         xF[:,ja]   = id_in.variables[L_VNEM[jv]][jt0:,1,1] # only the center point of the 3x3 spatial domain! 
     196        xF[:,ja]   = id_in.variables[L_VNEM[jv]][:,1,1] # only the center point of the 3x3 spatial domain! 
    214197        if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name 
    215198        id_in.close() 
    216199        # 
    217200        id_in = Dataset(cf_in_ns[ja]) 
    218         xFns[:,ja] = id_in.variables[L_VNEM[jv]][jt0:,1,1] # only the center point of the 3x3 spatial domain! 
     201        xFns[:,ja] = id_in.variables[L_VNEM[jv]][:,1,1] # only the center point of the 3x3 spatial domain! 
    219202        if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name 
    220203        id_in.close() 
     
    229212    rmlt = 10.**(int(romagn)) / 2. 
    230213    yrng = math.copysign( math.ceil(abs(rmax)/rmlt)*rmlt , rmax) 
    231     print 'yrng = ', yrng ;  #sys.exit(0) 
    232  
    233  
    234  
    235  
     214 
     215     
    236216    for ja in range(nb_algos-1): 
    237217 
  • NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves/tests/STATION_ASF/MY_SRC/nemogcm.F90

    r12641 r13710  
    3030   USE step_c1d       ! Time stepping loop for the 1D configuration 
    3131   ! 
     32   USE prtctl         ! Print control 
    3233   USE in_out_manager ! I/O manager 
    3334   USE lib_mpp        ! distributed memory computing 
     
    100101      IF( nstop /= 0 .AND. lwp ) THEN        ! error print 
    101102         WRITE(ctmp1,*) '   ==>>>   nemo_gcm: a total of ', nstop, ' errors have been found' 
    102          CALL ctl_stop( ctmp1 ) 
     103         WRITE(ctmp2,*) '           Look for "E R R O R" messages in all existing ocean_output* files' 
     104         CALL ctl_stop( ' ', ctmp1, ' ', ctmp2 ) 
    103105      ENDIF 
    104106      ! 
     
    130132      INTEGER ::   ios, ilocal_comm   ! local integers 
    131133      !! 
    132       NAMELIST/namctl/ sn_cfctl,  nn_print, nn_ictls, nn_ictle,             & 
    133          &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,             & 
    134          &             ln_timing, ln_diacfl 
     134      NAMELIST/namctl/ sn_cfctl, ln_timing, ln_diacfl,                                & 
     135         &             nn_isplt,  nn_jsplt,  nn_ictls, nn_ictle, nn_jctls, nn_jctle 
    135136      NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_closea, ln_write_cfg, cn_domcfg_out, ln_use_jattr 
    136137      !!---------------------------------------------------------------------- 
     
    184185      ! 
    185186      ! finalize the definition of namctl variables 
    186       IF( sn_cfctl%l_allon ) THEN 
    187          ! Turn on all options. 
    188          CALL nemo_set_cfctl( sn_cfctl, .TRUE., .TRUE. ) 
    189          ! Ensure all processors are active 
    190          sn_cfctl%procmin = 0 ; sn_cfctl%procmax = 1000000 ; sn_cfctl%procincr = 1 
    191       ELSEIF( sn_cfctl%l_config ) THEN 
    192          ! Activate finer control of report outputs 
    193          ! optionally switch off output from selected areas (note this only 
    194          ! applies to output which does not involve global communications) 
    195          IF( ( narea < sn_cfctl%procmin .OR. narea > sn_cfctl%procmax  ) .OR. & 
    196            & ( MOD( narea - sn_cfctl%procmin, sn_cfctl%procincr ) /= 0 ) )    & 
    197            &   CALL nemo_set_cfctl( sn_cfctl, .FALSE., .FALSE. ) 
    198       ELSE 
    199          ! turn off all options. 
    200          CALL nemo_set_cfctl( sn_cfctl, .FALSE., .TRUE. ) 
    201       ENDIF 
     187      IF( narea < sn_cfctl%procmin .OR. narea > sn_cfctl%procmax .OR. MOD( narea - sn_cfctl%procmin, sn_cfctl%procincr ) /= 0 )   & 
     188         &   CALL nemo_set_cfctl( sn_cfctl, .FALSE. ) 
    202189      ! 
    203190      lwp = (narea == 1) .OR. sn_cfctl%l_oceout    ! control of all listing output print 
     
    245232      ! 
    246233      IF( ln_read_cfg ) THEN            ! Read sizes in domain configuration file 
    247          CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     234         CALL domain_cfg ( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
    248235      ELSE                              ! user-defined namelist 
    249          CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     236         CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
    250237      ENDIF 
    251238      ! 
     
    308295         WRITE(numout,*) '~~~~~~~~' 
    309296         WRITE(numout,*) '   Namelist namctl' 
    310          WRITE(numout,*) '                              sn_cfctl%l_glochk  = ', sn_cfctl%l_glochk 
    311          WRITE(numout,*) '                              sn_cfctl%l_allon   = ', sn_cfctl%l_allon 
    312          WRITE(numout,*) '       finer control over o/p sn_cfctl%l_config  = ', sn_cfctl%l_config 
    313297         WRITE(numout,*) '                              sn_cfctl%l_runstat = ', sn_cfctl%l_runstat 
    314298         WRITE(numout,*) '                              sn_cfctl%l_trcstat = ', sn_cfctl%l_trcstat 
     
    322306         WRITE(numout,*) '                              sn_cfctl%procincr  = ', sn_cfctl%procincr  
    323307         WRITE(numout,*) '                              sn_cfctl%ptimincr  = ', sn_cfctl%ptimincr  
    324          WRITE(numout,*) '      level of print                  nn_print   = ', nn_print 
    325          WRITE(numout,*) '      Start i indice for SUM control  nn_ictls   = ', nn_ictls 
    326          WRITE(numout,*) '      End i indice for SUM control    nn_ictle   = ', nn_ictle 
    327          WRITE(numout,*) '      Start j indice for SUM control  nn_jctls   = ', nn_jctls 
    328          WRITE(numout,*) '      End j indice for SUM control    nn_jctle   = ', nn_jctle 
    329          WRITE(numout,*) '      number of proc. following i     nn_isplt   = ', nn_isplt 
    330          WRITE(numout,*) '      number of proc. following j     nn_jsplt   = ', nn_jsplt 
    331308         WRITE(numout,*) '      timing by routine               ln_timing  = ', ln_timing 
    332309         WRITE(numout,*) '      CFL diagnostics                 ln_diacfl  = ', ln_diacfl 
    333310      ENDIF 
    334311      ! 
    335       nprint    = nn_print          ! convert DOCTOR namelist names into OLD names 
    336       nictls    = nn_ictls 
    337       nictle    = nn_ictle 
    338       njctls    = nn_jctls 
    339       njctle    = nn_jctle 
    340       isplt     = nn_isplt 
    341       jsplt     = nn_jsplt 
    342  
     312      IF( .NOT.ln_read_cfg )   ln_closea = .false.   ! dealing possible only with a domcfg file 
    343313      IF(lwp) THEN                  ! control print 
    344314         WRITE(numout,*) 
     
    351321         WRITE(numout,*) '      use file attribute if exists as i/p j-start   ln_use_jattr     = ', ln_use_jattr 
    352322      ENDIF 
    353       IF( .NOT.ln_read_cfg )   ln_closea = .false.   ! dealing possible only with a domcfg file 
    354       ! 
    355       !                             ! Parameter control 
    356       ! 
    357       IF( sn_cfctl%l_prtctl .OR. sn_cfctl%l_prttrc ) THEN              ! sub-domain area indices for the control prints 
    358          IF( lk_mpp .AND. jpnij > 1 ) THEN 
    359             isplt = jpni   ;   jsplt = jpnj   ;   ijsplt = jpni*jpnj   ! the domain is forced to the real split domain 
    360          ELSE 
    361             IF( isplt == 1 .AND. jsplt == 1  ) THEN 
    362                CALL ctl_warn( ' - isplt & jsplt are equal to 1',   & 
    363                   &           ' - the print control will be done over the whole domain' ) 
    364             ENDIF 
    365             ijsplt = isplt * jsplt            ! total number of processors ijsplt 
    366          ENDIF 
    367          IF(lwp) WRITE(numout,*)'          - The total number of processors over which the' 
    368          IF(lwp) WRITE(numout,*)'            print control will be done is ijsplt : ', ijsplt 
    369          ! 
    370          !                              ! indices used for the SUM control 
    371          IF( nictls+nictle+njctls+njctle == 0 )   THEN    ! print control done over the default area 
    372             lsp_area = .FALSE. 
    373          ELSE                                             ! print control done over a specific  area 
    374             lsp_area = .TRUE. 
    375             IF( nictls < 1 .OR. nictls > jpiglo )   THEN 
    376                CALL ctl_warn( '          - nictls must be 1<=nictls>=jpiglo, it is forced to 1' ) 
    377                nictls = 1 
    378             ENDIF 
    379             IF( nictle < 1 .OR. nictle > jpiglo )   THEN 
    380                CALL ctl_warn( '          - nictle must be 1<=nictle>=jpiglo, it is forced to jpiglo' ) 
    381                nictle = jpiglo 
    382             ENDIF 
    383             IF( njctls < 1 .OR. njctls > jpjglo )   THEN 
    384                CALL ctl_warn( '          - njctls must be 1<=njctls>=jpjglo, it is forced to 1' ) 
    385                njctls = 1 
    386             ENDIF 
    387             IF( njctle < 1 .OR. njctle > jpjglo )   THEN 
    388                CALL ctl_warn( '          - njctle must be 1<=njctle>=jpjglo, it is forced to jpjglo' ) 
    389                njctle = jpjglo 
    390             ENDIF 
    391          ENDIF 
    392       ENDIF 
    393323      ! 
    394324      IF( 1._wp /= SIGN(1._wp,-0._wp)  )   CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows f2003 standard.',  & 
     
    446376 
    447377    
    448    SUBROUTINE nemo_set_cfctl(sn_cfctl, setto, for_all ) 
     378   SUBROUTINE nemo_set_cfctl(sn_cfctl, setto ) 
    449379      !!---------------------------------------------------------------------- 
    450380      !!                     ***  ROUTINE nemo_set_cfctl  *** 
    451381      !! 
    452382      !! ** Purpose :   Set elements of the output control structure to setto. 
    453       !!                for_all should be .false. unless all areas are to be 
    454       !!                treated identically. 
    455383      !! 
    456384      !! ** Method  :   Note this routine can be used to switch on/off some 
    457       !!                types of output for selected areas but any output types 
    458       !!                that involve global communications (e.g. mpp_max, glob_sum) 
    459       !!                should be protected from selective switching by the 
    460       !!                for_all argument 
    461       !!---------------------------------------------------------------------- 
    462       LOGICAL :: setto, for_all 
    463       TYPE(sn_ctl) :: sn_cfctl 
    464       !!---------------------------------------------------------------------- 
    465       IF( for_all ) THEN 
    466          sn_cfctl%l_runstat = setto 
    467          sn_cfctl%l_trcstat = setto 
    468       ENDIF 
     385      !!                types of output for selected areas. 
     386      !!---------------------------------------------------------------------- 
     387      TYPE(sn_ctl), INTENT(inout) :: sn_cfctl 
     388      LOGICAL     , INTENT(in   ) :: setto 
     389      !!---------------------------------------------------------------------- 
     390      sn_cfctl%l_runstat = setto 
     391      sn_cfctl%l_trcstat = setto 
    469392      sn_cfctl%l_oceout  = setto 
    470393      sn_cfctl%l_layout  = setto 
  • NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves/tests/STATION_ASF/MY_SRC/stpctl.F90

    r12254 r13710  
    1919   USE dom_oce         ! ocean space and time domain variables 
    2020   USE sbc_oce         ! surface fluxes and stuff 
     21   ! 
    2122   USE diawri          ! Standard run outputs       (dia_wri_state routine) 
    22    ! 
    2323   USE in_out_manager  ! I/O manager 
    2424   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    2525   USE lib_mpp         ! distributed memory computing 
    26  
     26   ! 
    2727   USE netcdf          ! NetCDF library 
    2828   IMPLICIT NONE 
     
    3131   PUBLIC stp_ctl           ! routine called by step.F90 
    3232 
    33    INTEGER  ::   idrun, idtime, idtau, idqns, idemp, istatus 
    34    LOGICAL  ::   lsomeoce 
     33   INTEGER                ::   nrunid   ! netcdf file id 
     34   INTEGER, DIMENSION(3)  ::   nvarid   ! netcdf variable id 
    3535   !!---------------------------------------------------------------------- 
    3636   !! NEMO/SAS 4.0 , NEMO Consortium (2018) 
     
    4040CONTAINS 
    4141 
    42    SUBROUTINE stp_ctl( kt, Kbb, Kmm, kindic ) 
     42   SUBROUTINE stp_ctl( kt, Kmm ) 
    4343      !!---------------------------------------------------------------------- 
    4444      !!                    ***  ROUTINE stp_ctl  *** 
    45       !! 
     45      !!                      
    4646      !! ** Purpose :   Control the run 
    4747      !! 
    4848      !! ** Method  : - Save the time step in numstp 
    49       !!              - Print it each 50 time steps 
    50       !!              - Stop the run IF problem encountered by setting indic=-3 
     49      !!              - Stop the run IF problem encountered by setting nstop > 0 
     50      !!                Problems checked: wind stress module  max larger than 5 N/m^2 
     51      !!                                  non-solar heat flux max larger than 2000 W/m^2 
     52      !!                                  Evaporation-Precip  max larger than 1.E-3 kg/m^2/s 
    5153      !! 
    5254      !! ** Actions :   "time.step" file = last ocean time-step 
    5355      !!                "run.stat"  file = run statistics 
    54       !!                nstop indicator sheared among all local domain (lk_mpp=T) 
     56      !!                 nstop indicator sheared among all local domain 
    5557      !!---------------------------------------------------------------------- 
    5658      INTEGER, INTENT(in   ) ::   kt       ! ocean time-step index 
    57       INTEGER, INTENT(in   ) ::   Kbb, Kmm      ! ocean time level index 
    58       INTEGER, INTENT(inout) ::   kindic   ! error indicator 
    59       !! 
    60       REAL(wp), DIMENSION(3) ::   zmax 
    61       LOGICAL                ::   ll_wrtstp, ll_colruns, ll_wrtruns 
    62       CHARACTER(len=20) :: clname 
    63       !!---------------------------------------------------------------------- 
    64       ! 
    65       ll_wrtstp  = ( MOD( kt, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) 
    66       ll_colruns = ll_wrtstp .AND. ( sn_cfctl%l_runstat ) 
    67       ll_wrtruns = ll_colruns .AND. lwm 
    68       IF( kt == nit000 .AND. lwp ) THEN 
    69          WRITE(numout,*) 
    70          WRITE(numout,*) 'stp_ctl : time-stepping control' 
    71          WRITE(numout,*) '~~~~~~~' 
    72          !                                ! open time.step file 
    73          IF( lwm ) CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
    74          !                                ! open run.stat file(s) at start whatever 
    75          !                                ! the value of sn_cfctl%ptimincr 
    76          IF( lwm .AND. ( sn_cfctl%l_runstat ) ) THEN 
     59      INTEGER, INTENT(in   ) ::   Kmm      ! ocean time level index 
     60      !! 
     61      INTEGER                         ::   ji                                    ! dummy loop indices 
     62      INTEGER                         ::   idtime, istatus 
     63      INTEGER , DIMENSION(4)          ::   iareasum, iareamin, iareamax 
     64      INTEGER , DIMENSION(3,3)        ::   iloc                                  ! min/max loc indices 
     65      REAL(wp)                        ::   zzz                                   ! local real  
     66      REAL(wp), DIMENSION(4)          ::   zmax, zmaxlocal 
     67      LOGICAL                         ::   ll_wrtstp, ll_colruns, ll_wrtruns, ll_0oce 
     68      LOGICAL, DIMENSION(jpi,jpj)     ::   llmsk 
     69      CHARACTER(len=20)               ::   clname 
     70      !!---------------------------------------------------------------------- 
     71      IF( nstop > 0 .AND. ngrdstop > -1 )   RETURN   !   stpctl was already called by a child grid 
     72      ! 
     73      ll_wrtstp  = ( MOD( kt-nit000, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) 
     74      ll_colruns = ll_wrtstp .AND. sn_cfctl%l_runstat .AND. jpnij > 1  
     75      ll_wrtruns = ( ll_colruns .OR. jpnij == 1 ) .AND. lwm 
     76      ! 
     77      IF( kt == nit000 ) THEN 
     78         ! 
     79         IF( lwp ) THEN 
     80            WRITE(numout,*) 
     81            WRITE(numout,*) 'stp_ctl : time-stepping control' 
     82            WRITE(numout,*) '~~~~~~~' 
     83         ENDIF 
     84         !                                ! open time.step    ascii file, done only by 1st subdomain 
     85         IF( lwm )   CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
     86         ! 
     87         IF( ll_wrtruns ) THEN 
     88            !                             ! open run.stat     ascii file, done only by 1st subdomain 
    7789            CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
     90            !                             ! open run.stat.nc netcdf file, done only by 1st subdomain 
    7891            clname = 'run.stat.nc' 
    7992            IF( .NOT. Agrif_Root() )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname) 
    80             istatus = NF90_CREATE( TRIM(clname), NF90_CLOBBER, idrun ) 
    81             istatus = NF90_DEF_DIM( idrun, 'time', NF90_UNLIMITED, idtime ) 
    82             istatus = NF90_DEF_VAR( idrun, 'tau_max', NF90_DOUBLE, (/ idtime /), idtau ) 
    83             istatus = NF90_DEF_VAR( idrun, 'qns_max', NF90_DOUBLE, (/ idtime /), idqns   ) 
    84             istatus = NF90_DEF_VAR( idrun, 'emp_max', NF90_DOUBLE, (/ idtime /), idemp   ) 
    85             istatus = NF90_ENDDEF(idrun) 
    86          ENDIF 
    87       ENDIF 
    88       IF( kt == nit000 )   lsomeoce = COUNT( ssmask(:,:) == 1._wp ) > 0 
    89       ! 
    90       IF(lwm .AND. ll_wrtstp) THEN        !==  current time step  ==!   ("time.step" file) 
     93            istatus = NF90_CREATE( TRIM(clname), NF90_CLOBBER, nrunid ) 
     94            istatus = NF90_DEF_DIM( nrunid, 'time', NF90_UNLIMITED, idtime ) 
     95            istatus = NF90_DEF_VAR( nrunid, 'tau_max', NF90_DOUBLE, (/ idtime /), nvarid(1) ) 
     96            istatus = NF90_DEF_VAR( nrunid, 'qns_max', NF90_DOUBLE, (/ idtime /), nvarid(2) ) 
     97            istatus = NF90_DEF_VAR( nrunid, 'emp_max', NF90_DOUBLE, (/ idtime /), nvarid(3) ) 
     98            istatus = NF90_ENDDEF(nrunid) 
     99         ENDIF 
     100         !     
     101      ENDIF 
     102      ! 
     103      !                                   !==              write current time step              ==! 
     104      !                                   !==  done only by 1st subdomain at writting timestep  ==! 
     105      IF( lwm .AND. ll_wrtstp ) THEN 
    91106         WRITE ( numstp, '(1x, i8)' )   kt 
    92107         REWIND( numstp ) 
    93108      ENDIF 
    94       ! 
    95       !                                   !==  test of extrema  ==! 
    96       zmax(1) = MAXVAL(     taum(:,:)   , mask = tmask(:,:,1) == 1._wp )                                         ! max wind stress module 
    97       zmax(2) = MAXVAL( ABS( qns(:,:) ) , mask = tmask(:,:,1) == 1._wp )                                         ! max non-solar heat flux 
    98       zmax(3) = MAXVAL( ABS( emp(:,:) ) , mask = tmask(:,:,1) == 1._wp )                                         ! max E-P 
    99       ! 
     109      !                                   !==            test of local extrema           ==! 
     110      !                                   !==  done by all processes at every time step  ==! 
     111      ! 
     112      llmsk(   1:Nis1,:) = .FALSE.                                              ! exclude halos from the checked region 
     113      llmsk(Nie1: jpi,:) = .FALSE. 
     114      llmsk(:,   1:Njs1) = .FALSE. 
     115      llmsk(:,Nje1: jpj) = .FALSE. 
     116      ! 
     117      llmsk(Nis0:Nie0,Njs0:Nje0) = tmask(Nis0:Nie0,Njs0:Nje0,1) == 1._wp        ! test only the inner domain 
     118      ! 
     119      ll_0oce = .NOT. ANY( llmsk(:,:) )                                         ! no ocean point in the inner domain? 
     120      ! 
     121      zmax(1) = MAXVAL(     taum(:,:)  , mask = llmsk )                         ! max wind stress module 
     122      zmax(2) = MAXVAL( ABS( qns(:,:) ), mask = llmsk )                         ! max non-solar heat flux 
     123      zmax(3) = MAXVAL( ABS( emp(:,:) ), mask = llmsk )                         ! max E-P 
     124      zmax(4) = REAL( nstop, wp )                                               ! stop indicator 
     125      ! 
     126      !                                   !==               get global extrema             ==! 
     127      !                                   !==  done by all processes if writting run.stat  ==! 
    100128      IF( ll_colruns ) THEN 
     129         zmaxlocal(:) = zmax(:) 
    101130         CALL mpp_max( "stpctl", zmax )          ! max over the global domain 
    102          nstop = NINT( zmax(3) )                 ! nstop indicator sheared among all local domains 
    103       ENDIF 
    104       !                                   !==  run statistics  ==!   ("run.stat" files) 
     131         nstop = NINT( zmax(4) )                 ! update nstop indicator (now sheared among all local domains) 
     132      ELSE 
     133         ! if no ocean point: MAXVAL returns -HUGE => we must overwrite this value to avoid error handling bellow. 
     134         IF( ll_0oce )   zmax(1:3) = 0._wp       ! default "valid" values... 
     135      ENDIF 
     136      !                                   !==               error handling               ==! 
     137      !                                   !==              write "run.stat" files              ==! 
     138      !                                   !==  done only by 1st subdomain at writting timestep  ==! 
    105139      IF( ll_wrtruns ) THEN 
    106140         WRITE(numrun,9500) kt, zmax(1), zmax(2), zmax(3) 
    107          istatus = NF90_PUT_VAR( idrun, idtau, (/ zmax(1)/), (/kt/), (/1/) ) 
    108          istatus = NF90_PUT_VAR( idrun, idqns, (/ zmax(2)/), (/kt/), (/1/) ) 
    109          istatus = NF90_PUT_VAR( idrun, idemp, (/ zmax(3)/), (/kt/), (/1/) ) 
    110          IF( MOD( kt , 100 ) == 0 ) istatus = NF90_SYNC(idrun) 
    111          IF( kt == nitend         ) istatus = NF90_CLOSE(idrun) 
     141         DO ji = 1, 3 
     142            istatus = NF90_PUT_VAR( nrunid, nvarid(ji), (/zmax(ji)/), (/kt/), (/1/) ) 
     143         END DO 
     144         IF( kt == nitend ) istatus = NF90_CLOSE(nrunid) 
    112145      END IF 
    113       !                                   !==  error handling  ==! 
    114       IF( ( sn_cfctl%l_glochk .OR. lsomeoce ) .AND. (   &  ! domain contains some ocean points, check for sensible ranges 
    115          &  zmax(1) >    5._wp .OR.   &             ! too large wind stress ( > 5 N/m^2 ) 
    116          &  zmax(2) > 2000._wp .OR.   &             ! too large non-solar heat flux ( > 2000 W/m^2) 
    117          &  zmax(3) > 1.E-3_wp .OR.   &             ! too large net freshwater flux ( kg/m^2/s) 
    118          &  ISNAN( zmax(1) + zmax(2) + zmax(3) ) ) ) THEN   ! NaN encounter in the tests 
    119  
    120          !! We are 1D so no need to find a spatial location of the rogue point. 
    121  
     146      !                                   !==               error handling               ==! 
     147      !                                   !==  done by all processes at every time step  ==! 
     148      ! 
     149      IF(   zmax(1) >    5._wp .OR.   &                   ! too large wind stress         ( > 5 N/m^2 ) 
     150         &  zmax(2) > 2000._wp .OR.   &                   ! too large non-solar heat flux ( > 2000 W/m^2 ) 
     151         &  zmax(3) > 1.E-3_wp .OR.   &                   ! too large net freshwater flux ( > 1.E-3 kg/m^2/s ) 
     152         &  ISNAN( zmax(1) + zmax(2) + zmax(3) ) .OR.   &               ! NaN encounter in the tests 
     153         &  ABS(   zmax(1) + zmax(2) + zmax(3) ) > HUGE(1._wp) ) THEN   ! Infinity encounter in the tests 
     154         ! 
     155         iloc(:,:) = 0 
     156         IF( ll_colruns ) THEN   ! zmax is global, so it is the same on all subdomains -> no dead lock with mpp_maxloc 
     157            ! first: close the netcdf file, so we can read it 
     158            IF( lwm .AND. kt /= nitend )   istatus = NF90_CLOSE(nrunid) 
     159            ! get global loc on the min/max 
     160            CALL mpp_maxloc( 'stpctl',    taum(:,:)  , llmsk, zzz, iloc(1:2,1) )   ! mpp_maxloc ok if mask = F  
     161            CALL mpp_maxloc( 'stpctl',ABS( qns(:,:) ), llmsk, zzz, iloc(1:2,2) ) 
     162            CALL mpp_minloc( 'stpctl',ABS( emp(:,:) ), llmsk, zzz, iloc(1:2,3) ) 
     163            ! find which subdomain has the max. 
     164            iareamin(:) = jpnij+1   ;   iareamax(:) = 0   ;   iareasum(:) = 0 
     165            DO ji = 1, 4 
     166               IF( zmaxlocal(ji) == zmax(ji) ) THEN 
     167                  iareamin(ji) = narea   ;   iareamax(ji) = narea   ;   iareasum(ji) = 1 
     168               ENDIF 
     169            END DO 
     170            CALL mpp_min( "stpctl", iareamin )         ! min over the global domain 
     171            CALL mpp_max( "stpctl", iareamax )         ! max over the global domain 
     172            CALL mpp_sum( "stpctl", iareasum )         ! sum over the global domain 
     173         ELSE                    ! find local min and max locations: 
     174            ! if we are here, this means that the subdomain contains some oce points -> no need to test the mask used in maxloc 
     175            iloc(1:2,1) = MAXLOC(     taum(:,:)  , mask = llmsk ) 
     176            iloc(1:2,2) = MAXLOC( ABS( qns(:,:) ), mask = llmsk ) 
     177            iloc(1:2,3) = MINLOC( ABS( emp(:,:) ), mask = llmsk ) 
     178            DO ji = 1, 3   ! local domain indices ==> global domain indices, excluding halos 
     179               iloc(1:2,ji) = (/ mig0(iloc(1,ji)), mjg0(iloc(2,ji)) /) 
     180            END DO 
     181            iareamin(:) = narea   ;   iareamax(:) = narea   ;   iareasum(:) = 1         ! this is local information 
     182         ENDIF 
     183         ! 
    122184         WRITE(ctmp1,*) ' stp_ctl: |tau_mod| > 5 N/m2  or  |qns| > 2000 W/m2  or |emp| > 1.E-3 or  NaN encounter in the tests' 
    123          WRITE(ctmp2,9500) kt,   zmax(1), zmax(2), zmax(3) 
    124          WRITE(ctmp6,*) '      ===> output of last computed fields in output.abort.nc file' 
    125  
     185         CALL wrt_line( ctmp2, kt, '|tau| max',  zmax(1), iloc(:,1), iareasum(1), iareamin(1), iareamax(1) ) 
     186         CALL wrt_line( ctmp3, kt, '|qns| max',  zmax(2), iloc(:,2), iareasum(2), iareamin(2), iareamax(2) ) 
     187         CALL wrt_line( ctmp4, kt, 'emp   max',  zmax(3), iloc(:,3), iareasum(3), iareamin(3), iareamax(3) ) 
     188         IF( Agrif_Root() ) THEN 
     189            WRITE(ctmp6,*) '      ===> output of last computed fields in output.abort* files' 
     190         ELSE 
     191            WRITE(ctmp6,*) '      ===> output of last computed fields in '//TRIM(Agrif_CFixed())//'_output.abort* files' 
     192         ENDIF 
     193         ! 
    126194         CALL dia_wri_state( Kmm, 'output.abort' )     ! create an output.abort file 
    127  
    128          IF( .NOT. sn_cfctl%l_glochk ) THEN 
    129             WRITE(ctmp8,*) 'E R R O R message from sub-domain: ', narea 
    130             CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp2, ' ', ctmp6, ' ' ) 
    131          ELSE 
    132             CALL ctl_stop( ctmp1, ' ', ctmp2, ' ', ctmp6, ' ' ) 
    133          ENDIF 
    134  
    135          kindic = -3 
    136          ! 
     195         ! 
     196         IF( ll_colruns .or. jpnij == 1 ) THEN   ! all processes synchronized -> use lwp to print in opened ocean.output files 
     197            IF(lwp) THEN   ;   CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 ) 
     198            ELSE           ;   nstop = MAX(1, nstop)   ! make sure nstop > 0 (automatically done when calling ctl_stop) 
     199            ENDIF 
     200         ELSE                                    ! only mpi subdomains with errors are here -> STOP now 
     201            CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 ) 
     202         ENDIF 
     203         ! 
     204      ENDIF 
     205      ! 
     206      IF( nstop > 0 ) THEN                                                  ! an error was detected and we did not abort yet... 
     207         ngrdstop = Agrif_Fixed()                                           ! store which grid got this error 
     208         IF( .NOT. ll_colruns .AND. jpnij > 1 )   CALL ctl_stop( 'STOP' )   ! we must abort here to avoid MPI deadlock 
    137209      ENDIF 
    138210      ! 
     
    140212      ! 
    141213   END SUBROUTINE stp_ctl 
     214 
     215 
     216   SUBROUTINE wrt_line( cdline, kt, cdprefix, pval, kloc, ksum, kmin, kmax ) 
     217      !!---------------------------------------------------------------------- 
     218      !!                     ***  ROUTINE wrt_line  *** 
     219      !! 
     220      !! ** Purpose :   write information line 
     221      !! 
     222      !!---------------------------------------------------------------------- 
     223      CHARACTER(len=*),      INTENT(  out) ::   cdline 
     224      CHARACTER(len=*),      INTENT(in   ) ::   cdprefix 
     225      REAL(wp),              INTENT(in   ) ::   pval 
     226      INTEGER, DIMENSION(3), INTENT(in   ) ::   kloc 
     227      INTEGER,               INTENT(in   ) ::   kt, ksum, kmin, kmax 
     228      ! 
     229      CHARACTER(len=80) ::   clsuff 
     230      CHARACTER(len=9 ) ::   clkt, clsum, clmin, clmax 
     231      CHARACTER(len=9 ) ::   cli, clj, clk 
     232      CHARACTER(len=1 ) ::   clfmt 
     233      CHARACTER(len=4 ) ::   cl4   ! needed to be able to compile with Agrif, I don't know why 
     234      INTEGER           ::   ifmtk 
     235      !!---------------------------------------------------------------------- 
     236      WRITE(clkt , '(i9)') kt 
     237       
     238      WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpnij  ,wp))) + 1     ! how many digits to we need to write ? (we decide max = 9) 
     239      !!! WRITE(clsum, '(i'//clfmt//')') ksum                   ! this is creating a compilation error with AGRIF 
     240      cl4 = '(i'//clfmt//')'   ;   WRITE(clsum, cl4) ksum 
     241      WRITE(clfmt, '(i1)') INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1    ! how many digits to we need to write ? (we decide max = 9) 
     242      cl4 = '(i'//clfmt//')'   ;   WRITE(clmin, cl4) kmin-1 
     243                                   WRITE(clmax, cl4) kmax-1 
     244      ! 
     245      WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpiglo,wp))) + 1      ! how many digits to we need to write jpiglo? (we decide max = 9) 
     246      cl4 = '(i'//clfmt//')'   ;   WRITE(cli, cl4) kloc(1)      ! this is ok with AGRIF 
     247      WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpjglo,wp))) + 1      ! how many digits to we need to write jpjglo? (we decide max = 9) 
     248      cl4 = '(i'//clfmt//')'   ;   WRITE(clj, cl4) kloc(2)      ! this is ok with AGRIF 
     249      ! 
     250      IF( ksum == 1 ) THEN   ;   WRITE(clsuff,9100) TRIM(clmin) 
     251      ELSE                   ;   WRITE(clsuff,9200) TRIM(clsum), TRIM(clmin), TRIM(clmax) 
     252      ENDIF 
     253      IF(kloc(3) == 0) THEN 
     254         ifmtk = INT(LOG10(REAL(jpk,wp))) + 1                   ! how many digits to we need to write jpk? (we decide max = 9) 
     255         clk = REPEAT(' ', ifmtk)                               ! create the equivalent in blank string 
     256         WRITE(cdline,9300) TRIM(ADJUSTL(clkt)), TRIM(ADJUSTL(cdprefix)), pval, TRIM(cli), TRIM(clj), clk(1:ifmtk), TRIM(clsuff) 
     257      ELSE 
     258         WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpk,wp))) + 1      ! how many digits to we need to write jpk? (we decide max = 9) 
     259         !!! WRITE(clk, '(i'//clfmt//')') kloc(3)               ! this is creating a compilation error with AGRIF 
     260         cl4 = '(i'//clfmt//')'   ;   WRITE(clk, cl4) kloc(3)   ! this is ok with AGRIF 
     261         WRITE(cdline,9400) TRIM(ADJUSTL(clkt)), TRIM(ADJUSTL(cdprefix)), pval, TRIM(cli), TRIM(clj),    TRIM(clk), TRIM(clsuff) 
     262      ENDIF 
     263      ! 
     2649100  FORMAT('MPI rank ', a) 
     2659200  FORMAT('found in ', a, ' MPI tasks, spread out among ranks ', a, ' to ', a) 
     2669300  FORMAT('kt ', a, ' ', a, ' ', 1pg11.4, ' at i j   ', a, ' ', a, ' ', a, ' ', a) 
     2679400  FORMAT('kt ', a, ' ', a, ' ', 1pg11.4, ' at i j k ', a, ' ', a, ' ', a, ' ', a) 
     268      ! 
     269   END SUBROUTINE wrt_line 
     270 
    142271 
    143272   !!====================================================================== 
  • NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves/tests/STATION_ASF/MY_SRC/usrdef_hgr.F90

    r12629 r13710  
    1414   !!   usr_def_hgr   : initialize the horizontal mesh  
    1515   !!---------------------------------------------------------------------- 
    16    USE dom_oce  , ONLY: nimpp, njmpp       ! ocean space and time domain 
    1716   USE c1d      ,  ONLY: rn_lon1d, rn_lat1d ! ocean lon/lat define by namelist 
    1817   USE par_oce        ! ocean space and time domain 
  • NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves/tests/STATION_ASF/MY_SRC/usrdef_nam.F90

    r12629 r13710  
    1515   !!   usr_def_hgr   : initialize the horizontal mesh  
    1616   !!---------------------------------------------------------------------- 
    17    USE dom_oce  , ONLY: nimpp, njmpp       ! ocean space and time domain 
    18 !!!   USE dom_oce  , ONLY: ln_zco, ln_zps, ln_sco   ! flag of type of coordinate 
    1917   USE par_oce        ! ocean space and time domain 
    2018   USE phycst         ! physical constants 
  • NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves/tests/STATION_ASF/README.md

    r12031 r13710  
     1# *Station Air-Sea Fluxes* demonstration case 
    12 
    2 ## WARNING: TOTALLY-ALPHA-STUFF / DOCUMENT IN THE PROCESS OF BEING WRITEN! 
     3Last successful test done with NEMOGCM trunk: `r13263` 
    34 
    4 # *Station Air-Sea Fluxes* demonstration case 
     5Author: Laurent Brodeau, 2020 
     6 
     7NOTE: if working with the trunk of NEMO, you are strongly advised to use the same test-case but on the `NEMO-examples` GitHub depo: 
     8https://github.com/NEMO-ocean/NEMO-examples/tree/master/STATION_ASF 
    59 
    610## Objectives 
    711 
    8 ```STATION_ASF``` is a demonstration case that mimics an in-situ station (buoy, platform) dedicated to the estimation of surface air-sea fluxes by means of the measurement of traditional meteorological surface parameters. 
     12```STATION_ASF``` is a demonstration test-case that mimics a (static) in-situ station (buoy, platform) dedicated to the estimation of surface air-sea fluxes by means of *widely-measured* (bulk) meteorological surface parameters. 
    913 
    10 ```STATION_ASF``` is based on the merging of the "single column" and the "standalone surface module" configurations of NEMO. In short, it coulb defined as "SAS meets C1D". As such, the spatial domain of ```STATION_ASF``` is punctual (1D, well actually 3 x 3 as in C1D). 
     14```STATION_ASF``` has been constructed by merging the *single column* and the *standalone surface module* configurations of NEMO. In short, it can be defined as "SAS meets C1D". As such, the spatial domain of ```STATION_ASF``` is punctual (1D, well actually 3 x 3 as in C1D). 
    1115 
    12 ```STATION_ASF``` is therefore a versatile tool, and extremely light in terms of computing requirements, to test the different bulk algorithms and cool-skin/warm-layer parameterization options included in NEMO. 
     16```STATION_ASF``` is therefore a versatile tool, and extremely lightweight in terms of computing requirements, to test the different bulk algorithms and cool-skin/warm-layer parameterization options included in NEMO. 
    1317 
    1418As input ```STATION_ASF``` will require the traditional *bulk* sea surface parameters: 
    1519 
    16 - sea surface temperature (SST) at $z_{SST}$ meters below the surface 
     20- Bulk sea surface temperature (SST) at _z<sub>SST</sub>_ meters below the surface 
    1721- Surface current vector 
    1822- Sea surface salinity 
     
    2024as well as the usual surface atmospheric state: 
    2125 
    22 - air temperature at $z_t$ meters above the surface 
    23 - air humidity  at $z_t$ meters above the surface (specific humidity or relative humidity or dew-point temperature) 
    24 - wind speed vector at $z_u$ meters above the surface 
     26- air temperature at _z<sub>t</sub>_ meters above the surface 
     27- air humidity  at _z<sub>t</sub>_ meters above the surface (specific humidity or relative humidity or dew-point temperature) 
     28- wind speed vector at _z<sub>u</sub>_ meters above the surface 
    2529- Sea level atmospheric pressure (SLP) 
    2630- Downwelling solar radiation 
    2731- Downwelling longwave radiation 
    2832 
     33### Example of diagnostics from `STATION_ASF` 
     34 
     35(Generated with script `./EXPREF/plot_station_asf_simple.py`) 
     36 
     37![plot](https://github.com/NEMO-ocean/NEMO-examples/blob/master/STATION_ASF/figs/01_temperatures_ECMWF.svg) 
     38 
     39![plot](https://github.com/NEMO-ocean/NEMO-examples/blob/master/STATION_ASF/figs/Cd.svg) 
     40 
     41![plot](https://github.com/NEMO-ocean/NEMO-examples/blob/master/STATION_ASF/figs/dT_skin.svg) 
     42 
     43![plot](https://github.com/NEMO-ocean/NEMO-examples/blob/master/STATION_ASF/figs/Qlat.svg) 
    2944 
    3045 
    3146## Physical description 
    3247 
    33 ### Important namelist parameters speficic to STATION_ASF 
     48### Important namelist parameters specific to STATION_ASF 
    3449 
    35 * ```rn_dept1@namusr_def:``` depth (m) at which the prescribed SST is taken (i.e. depth of first T-point); important due to impact on warm-layer estimate, the deeper, the more pronounced! 
     50* ```rn_dept1@namusr_def:``` depth (m) at which the prescribed SST is taken (*i.e.* depth of first T-point); important due to impact on warm-layer estimate, the deeper, the more pronounced! 
    3651 
    3752* ```rn_lat1d,rn_lon1d@namc1d:``` fixed coordinates of the location of the station (buoy, platform, etc). 
     
    4560## Input files to test STATION ASF 
    4661 
    47 Three full years of processed hourly data from the PAPA station (buoy) can be downloaded here: 
    48 https://drive.google.com/file/d/1MxNvjhRHmMrL54y6RX7WIaM9-LGl--ZP/ 
     62One full year (2018) of processed hourly data from the PAPA station (buoy) is found into the `input_data` directory. 
     63These three files are everything you need to play with the set of *namelists* provided for this test-case. 
    4964 
    50 These three files are everything you need to play with the set of namelists provided for this test-case. 
    51  
    52 - ```Station_PAPA_50N-145W_atm_hourly.nc```  → contains hourly surface atmospheric state 
    53 - ```Station_PAPA_50N-145W_precip_daily.nc``` → contains daily precipitation 
    54 - ```Station_PAPA_50N-145W_oce_hourly.nc``` → contains hourly sea surface state 
     65- ```Station_PAPA_50N-145W_atm_hourly_y2018.nc```  → contains hourly surface atmospheric state 
     66- ```Station_PAPA_50N-145W_precip_daily_y2018.nc``` → contains daily precipitation 
     67- ```Station_PAPA_50N-145W_oce_hourly_y2018.nc``` → contains hourly sea surface state 
    5568 
    5669For station PAPA (50.1 N, 144.9 W), air temperature and humidity are measured at 2.5 m, the wind speed at 4 m, and the SST at 1 m below the surface, hence the following namelist parameters are given: 
    5770 
    58 - ```rn_dept1 =    1.  ``` (&namusr_def) 
    59 - ```rn_lat1d =  50.1 ``` (&namc1d) 
    60 - ```rn_lon1d = 215.1``` (&namc1d) 
    61 - ```rn_zqt   =   2.5``` (&namsbc_blk) 
    62 - ```rn_zu    =    4.``` (&namsbc_blk) 
     71- `&namusr_def` 
     72  - ```rn_dept1 =    1.  ``` 
     73- `&namc1d` 
     74  - ```rn_lat1d =  50.1 ``` 
     75  - ```rn_lon1d = 215.1``` 
     76- `&namsbc_blk` 
     77  - ```rn_zqt   =   2.5``` 
     78  - ```rn_zu    =    4.``` 
    6379 
    6480 
     
    6884First compile the test-case as follows (compile with xios-2.5 support → check your ARCH file): 
    6985 
    70 ```./makenemo -m <your_arch> -n STATION_ASF -j 4 -a STATION_ASF``` 
     86```./makenemo -a STATION_ASF -m <your_arch> -n STATION_ASF2 -j 4``` 
    7187 
    7288Then you can use the script ``launch_sasf.sh`` found in  ```EXPREF/``` to launch 3 simulations (one for each bulk parameterization available). You need to adapt the following variable to your environment in the script: 
    7389 
    74 - ```NEMO_DIR``` : NEMO root directory where to fetch compiled STATION_ASF ```nemo.exe``` + setup (such as ```${NEMO_DIR}/tests/STATION_ASF```) 
     90- ```NEMO_ROOT_DIR``` : NEMO root directory where to fetch compiled STATION_ASF ```nemo.exe``` + setup (such as ```${NEMO_ROOT_DIR}/tests/STATION_ASF```) 
    7591 
    76 - ```WORK_DIR``` :  Directory where to run the simulation 
     92- ```PROD_DIR``` :  Directory where to run the simulation 
    7793 
    78 - ```FORC_DIR```  Directory containing sea-surface + atmospheric forcings (get it there https://drive.google.com/file/d/1MxNvjhRHmMrL54y6RX7WIaM9-LGl--ZP/) 
     94- ```DATA_IN_DIR``` : Directory containing sea-surface + atmospheric forcings (found here in ```input_data/```) 
    7995 
     96If everything goes according to plan, ``launch_sasf.sh`` should have generated the 3 following sets of output files into `${PROD_DIR}/output`: 
     97 
     98    STATION_ASF-COARE3p6_1h_20180101_20181231_gridT.nc 
     99    STATION_ASF-COARE3p6_1h_20180101_20181231_gridU.nc  
     100    STATION_ASF-COARE3p6_1h_20180101_20181231_gridV.nc  
     101    STATION_ASF-ECMWF_1h_20180101_20181231_gridT.nc  
     102    STATION_ASF-ECMWF_1h_20180101_20181231_gridU.nc  
     103    STATION_ASF-ECMWF_1h_20180101_20181231_gridV.nc  
     104    STATION_ASF-NCAR_1h_20180101_20181231_gridT.nc  
     105    STATION_ASF-NCAR_1h_20180101_20181231_gridU.nc  
     106    STATION_ASF-NCAR_1h_20180101_20181231_gridV.nc 
     107 
     108--- 
     109 
     110*/Laurent, July 2020.* 
     111 
Note: See TracChangeset for help on using the changeset viewer.