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 6796 for branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/TOOLS/REBUILD_NEMO/icb_combrest.py – NEMO

Ignore:
Timestamp:
2016-07-06T17:35:54+02:00 (8 years ago)
Author:
clem
Message:

rewriting of ice rheology to conserve energy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/TOOLS/REBUILD_NEMO/icb_combrest.py

    r6449 r6796  
    169169    sys.exit(15) 
    170170  fo = Dataset(pathout, 'w') 
    171   for dim in ['x','y','c']: 
     171  for dim in ['x','y','c','k']: 
    172172    indim = fi.dimensions[dim] 
    173173    fo.createDimension(dim, len(indim)) 
    174   for var in ['calving','calving_hflx','stored_ice','stored_heat']: 
     174  for var in ['kount','calving','calving_hflx','stored_ice','stored_heat']: 
    175175    invar = fi.variables[var] 
    176176    fo.createVariable(var, invar.datatype, invar.dimensions) 
    177177    fo.variables[var][:] = invar[:] 
    178     fo.variables[var].long_name = invar.long_name 
    179     fo.variables[var].units = invar.units 
     178    if "long_name" in invar.ncattrs(): 
     179        fo.variables[var].long_name = invar.long_name 
     180    if "units" in invar.ncattrs(): 
     181        fo.variables[var].units = invar.units 
    180182  os.remove(pathout.replace('.nc','_WORK.nc')) 
    181183# 
Note: See TracChangeset for help on using the changeset viewer.