Changeset 5915 for TOOLS


Ignore:
Timestamp:
09/13/21 10:24:46 (3 years ago)
Author:
snguyen
Message:

Ajout de l'option --ocePerio à RunoffWeights?.py et CalvingWeights?.py

Location:
TOOLS/MOSAIX
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/MOSAIX/CalvingWeights.py

    r4298 r5915  
    4444parser.add_argument ('--output'  , help='output rmp file name', default='rmp_tlmd_to_torc_calving.nc' ) 
    4545parser.add_argument ('--fmt'     , help='NetCDF file format, using nco syntax', default='netcdf4', choices=['classic', 'netcdf3', '64bit', '64bit_data', '64bit_data', 'netcdf4', 'netcdf4_classsic'] ) 
     46parser.add_argument ('--ocePerio'   , help='periodicity of ocean grid', type=int, default=0 ) 
    4647 
    4748# Parse command line 
     
    110111print ('dst_mskutil : ' + str(np.sum(dst_mskutil))) 
    111112 
     113# Ocean grid periodicity 
     114nperio_dst=myargs.ocePerio 
     115 
    112116# Periodicity masking for NEMO 
    113 if dst_Name == 'ORCA2.3'    : nperio_dst = 4 
    114 if dst_Name == 'eORCA1.2'   : nperio_dst = 6 
    115 if dst_Name == 'ORCA025'    : nperio_dst = 6 
    116 if dst_Name == 'eORCA025'   : nperio_dst = 6 
    117 if dst_Name == 'eORCA025.1' : nperio_dst = 6 
     117if nperio_dst == 0 : 
     118    if dst_Name == 'ORCA2.3'    : nperio_dst = 4 
     119    if dst_Name == 'eORCA1.2'   : nperio_dst = 6 
     120    if dst_Name == 'ORCA025'    : nperio_dst = 6 
     121    if dst_Name == 'eORCA025'   : nperio_dst = 6 
     122    if dst_Name == 'eORCA025.1' : nperio_dst = 6 
    118123print ('nperio_dst: ' + str(nperio_dst) ) 
    119124dst_mskutil = nemo.lbc_mask (dst_mskutil, nperio=nperio_dst, cd_type='T' ) 
  • TOOLS/MOSAIX/RunoffWeights.py

    r4298 r5915  
    6868parser.add_argument ('--output', help='output rmp file name', default='rmp_tlmd_to_torc_runoff.nc' ) 
    6969parser.add_argument ('--fmt'   , help='NetCDF file format, using nco syntax', default='netcdf4', choices=['classic', 'netcdf3', '64bit', '64bit_data', '64bit_data', 'netcdf4', 'netcdf4_classsic'] ) 
     70parser.add_argument ('--ocePerio'   , help='periodicity of ocean grid', type=int, default=0 ) 
    7071 
    7172# Parse command line 
     
    101102print ('atmQuantity : ' + str (myargs.atmQuantity) ) 
    102103print ('oceQuantity : ' + str (myargs.oceQuantity) ) 
    103      
     104 
     105# Ocean grid periodicity 
     106oce_perio=myargs.ocePerio 
     107 
    104108### Read coordinates of all models 
    105109### 
     
    141145oce_grid_imask      = 1-maskFile['torc.msk'][:].ravel() 
    142146oce_grid_dims       = gridFile['torc.lat'][:].shape 
    143 if oce_jpi ==  182 : oce_perio = 4 # ORCA 2 
    144 if oce_jpi ==  362 : oce_perio = 6 # ORCA 1 
    145 if oce_jpi == 1442 : oce_perio = 6 # ORCA 025 
     147if oce_perio == 0 : 
     148    if oce_jpi ==  182 : oce_perio = 4 # ORCA 2 
     149    if oce_jpi ==  362 : oce_perio = 6 # ORCA 1 
     150    if oce_jpi == 1442 : oce_perio = 6 # ORCA 025 
     151print(f"oce_perio = {oce_perio}") 
    146152oce_grid_pmask = nemo.lbc_mask (np.reshape(oce_grid_imask, (oce_jpj,oce_jpi)), 'T', oce_perio).ravel() 
    147153oce_address = np.arange(oce_jpj*oce_jpi) 
Note: See TracChangeset for help on using the changeset viewer.