Setting up a JRA55-do forced experiment

rfarneti

Riccardo Farneti
New Member
Hi All,

I know this is about MOM6 queries so I won't mention I am using MOM5 ...
The questions I have are related to the JRA55-do forcing fields, which in
are fed to MOM6.

1/ How do you preprocess friver and licalvf so they are on the model grid? any tool available? I didn't find it in
I have downloaded both files and it seems they have both been regridded with regrid_runoff.py

2/ I do not seem to find the file
PHC2_salx.2004_08_03.corrected.nc
in order to generate salt_restore.nc with interpSaltRestore_PHC2.py.
Is that file available?

3/ Also, in OM4_025 the file
salt_restore_JRA.1440x1080.v20190706.nc
is used. Which SSS was used in this case?

Thanks,
Riccardo
 
The only one I can answer is about regrid_runoff, which is here: GitHub - adcroft/regrid_runoff: Conservatively re-grids runoff data to the nearest coastal wet-point of a MOM6 ocean grid

FMS doesn't like the NaNs in the output so we run another script to clear them out:
chinook02.rcs.alaska.edu 206% more modify_regrid_output.py
from subprocess import call
import xarray
import sys

year = sys.argv[1]
# Open output from regrid_runoff
# Fill any missing/nan values with zero.
base = xarray.open_dataset('GOA_runoff_'+year+'.nc').fillna(0)

# Choose where to save the results from this script
output_file = 'GOA_runoff_'+year+'_a.nc'

# Save file, making sure that time is the unlimited dimension.
compress = True
if compress:
fileformat, zlib, complevel, area_dtype = 'NETCDF4', True, 1, 'f4'
else:
fileformat, zlib, complevel, area_dtype = 'NETCDF3_64BIT_OFFSET', None, None, 'd'

comp = dict(zlib=zlib, complevel=complevel)
encoding = {var: comp for var in base.data_vars}
base.to_netcdf(
output_file,
unlimited_dims=['time'],
format=fileformat,
encoding=encoding
)

# Delete the _FillValue attribute.
# MOM will crash if this attribute is present.
# I can't find how to get xarray to not write it.
# Need to have NCO in your path or module load nco before running this script.
# Get rid of all of them, or just that of friver:
call(f'ncatted -h -O -a _FillValue,,d,, {output_file}', shell=True)
#call(f'ncatted -h -O -a _FillValue,friver,d,, {output_file}', shell=True)

Then the script to run them both looks like:
Code:
#!/bin/bash
#year=1995
for year in {1992..2020}
do
  python regrid_runoff.py /import/c1/AKWATERS/kate/ESMG/ESMG-configs/NGOA/INPUT/ocean_hgrid.nc /import/c1/AKWATERS/kate/ESMG/ESMG-configs/NGOA/INPUT/ocean_mask.nc /import/AKWATERS/kshedstrom/JRA55-do/
friver_OMIP_MRI-JRA55-do-1-5-0_gr_${year}.nc GOA_runoff_${year}.nc -z --regional_domain -r friver --progress --fast_pickle --fms

  python modify_regrid_output.py ${year}
done
I've hacked in an option for regional domains as opposed to global, otherwise it tries to include the rest of the world's runoff somewhere.
 
Back
Top