Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Issue with Missing 'U' Field After Regridding fv09 Initial File

Will Smith

Will Smith
Member
Hi all,

I intend to regrid an fv09 Cam-Chem_ic_nudge.cam.i.2010-01-08-00000.nc file onto a SE grid. There were no errors shown in the log file during the regridding process. However, when I use it as the ncdata to run CESM2.2, I meet the following error in both the atm.log and cesm.log files:

ERROR: DYN_FIELD_EXISTS: U was not present in the input file

I checked the data before and after regridding, and it seems that the wind-related variables have disappeared in the regridded file.

Below is the code I used. Could you please advise where the issue might be?
module load use.own
module load esmf/8.6.1
module load libs/gcc/nco/4.8.1

export srcgrid=f09
export dstgrid=ne0np4.UK_ne30x16
export srcgridfile="/mnt/iusers01/fatpou01/sees01/s29826zs/scratch/MUSICARE/ne0np4.UK_ne30x16/inic/fv0.9x1.25_141008.nc"
export dstgridfile="/mnt/iusers01/fatpou01/sees01/s29826zs/scratch/MUSICARE/ne0np4.UK_ne30x16/grids/UK_ne30x16_np4_SCRIP.nc"

export srcinitfile="/mnt/iusers01/fatpou01/sees01/s29826zs/scratch/Projects/archive/2.2project/cam-chem_ic_nudge/atm/hist/cam-chem_ic_nudge.cam.i.2010-01-08-00000.nc"
export dstinitfile="/mnt/iusers01/fatpou01/sees01/s29826zs/scratch/MUSICARE/ne0np4.UK_ne30x16/inic/test.nc"

ESMF_RegridWeightGen --ignore_unmapped --method conserve --weight map_${srcgrid}_to_${dstgrid}.nc --source ${srcgridfile} --destination ${dstgridfile}

ncremap -m ./map_${srcgrid}_to_${dstgrid}.nc -i ${srcinitfile} -o ${dstinitfile}

Many thanks
 

Attachments

  • PET0.RegridWeightGen.Log.txt
    3 KB · Views: 1
  • atm.log.250327-164025.txt
    64.6 KB · Views: 0
  • cesm.log.250327-164025.txt
    104.4 KB · Views: 0

hplin

Haipeng Lin
Moderator
Staff member
Hi Will Smith,

I am not sure why ncremap is not regridding the wind fields. Could you try running ncremap with the -v option to just regrid the wind-related variables (e.g., `ncremap -v U,V`) to see if maybe there are more detailed logs or if that can succeed?

Alternatively, in the CAM-chem / MUSICA wiki there are a collection of regridding tools that I previously used to regrid CAM-chem initial condition files from the FV to the SE grid: Input Processing Tools - MUSICA - wiki.ucar.edu - I checked and my outputs from that (which I believe should also be using ESMF for regridding, via NCL) did have the wind fields. So if it is possible I would also suggest trying to use the scripts from there (IPT/Initial_conditions/regrid_all_spectral_data.ncl at master · NCAR/IPT is what I used).
 

Will Smith

Will Smith
Member
Hi Will Smith,

I am not sure why ncremap is not regridding the wind fields. Could you try running ncremap with the -v option to just regrid the wind-related variables (e.g., `ncremap -v U,V`) to see if maybe there are more detailed logs or if that can succeed?

Alternatively, in the CAM-chem / MUSICA wiki there are a collection of regridding tools that I previously used to regrid CAM-chem initial condition files from the FV to the SE grid: Input Processing Tools - MUSICA - wiki.ucar.edu - I checked and my outputs from that (which I believe should also be using ESMF for regridding, via NCL) did have the wind fields. So if it is possible I would also suggest trying to use the scripts from there (IPT/Initial_conditions/regrid_all_spectral_data.ncl at master · NCAR/IPT is what I used).
Hi Lin,
Thank you very much for your reply.
I’ve tried regridding only the wind-related variables using ncremap -v, but unfortunately, the resulting regridded file still does not contain these variables.

From what I can tell, the wind fields in the CAM-Chem (FV grid) initial condition files are stored as US and VS, for example:

double US(time, lev, slat, lon) ;
US:mdims = 1 ;
US:units = "m/s" ;
US:long_name = "Zonal wind, staggered" ;


Whereas in MUSICA (SE grid), the winds appear as U and V, such as:

double U(time, lev, ncol) ;
U:long_name = "Zonal wind" ;
U:units = "m/s" ;
U:mdims = 1 ;
U:_FillValue = 9.96920996838687e+36 ;


This discrepancy in variable names and grid staggering may be why ncremap isn’t handling the conversion as expected, though I’m still not entirely certain.

Regarding the IPT scripts you mentioned: I’ve previously used them successfully for SE-to-SE regridding of initial conditions. Are you saying they also support FV-to-SE regridding?

Many thanks again for your suggestions!
 

hplin

Haipeng Lin
Moderator
Staff member
Sorry, you're right, I likely had my scripts mixed up. I vaguely remember that I did some regridding (a long time ago...) between f09 and ne30 but maybe it was not through IPT (so I am not sure if IPT will be able to do FV-to-SE regridding); I might have done the regridding for the chemical tracers only, then combined that information into a ne30 initial conditions file (spun up separately) which had the SE winds.

I will move this thread to the CAM-chem forum for more visibility from the chemistry folks, who may have a more accurate answer as to how to regrid FV initial conditions for use on the SE grid. Thanks!
 

shawnh

New Member
Hi Will,

I am thinking that what might be happening is that the FV IC file contains staggered winds (US, and VS) instead of the typical U and V winds that the SE IC file needs. Recent versions of ncremap exclude converting staggered variables by default (including US and VS - see the --no_stg_grd flag in ncremap --help), and it won't convert them to unstaggered variables either.

We have a script package that takes care of this at MUSICA-Tools/IPT/Initial_conditions/convert_fv2se at main · NCAR/MUSICA-Tools. We just uploaded it today so it still needs a couple of minor tweaks and needs some better documentation, but all you really need to do is set an input FV IC file to convert, set an output file to write, give it a template SE IC file to work from, and finally a map grid file. As long as you are converting a 1 degree f09 FV IC file you can just leave the map grid file that is already given and it should work.

-Shawn Honomichl
 

Will Smith

Will Smith
Member
Hi Will,

I am thinking that what might be happening is that the FV IC file contains staggered winds (US, and VS) instead of the typical U and V winds that the SE IC file needs. Recent versions of ncremap exclude converting staggered variables by default (including US and VS - see the --no_stg_grd flag in ncremap --help), and it won't convert them to unstaggered variables either.

We have a script package that takes care of this at MUSICA-Tools/IPT/Initial_conditions/convert_fv2se at main · NCAR/MUSICA-Tools. We just uploaded it today so it still needs a couple of minor tweaks and needs some better documentation, but all you really need to do is set an input FV IC file to convert, set an output file to write, give it a template SE IC file to work from, and finally a map grid file. As long as you are converting a 1 degree f09 FV IC file you can just leave the map grid file that is already given and it should work.

-Shawn Honomichl
Hi Shawn,

Thank you very much for the explanation — that makes a lot of sense.

Couple days ago, I used an alternative method to perform the interpolation and have since used the result as the initial conditions to run MUSICA. So far, everything seems to be working fine. I first extracted the lat/lon/area from the VR grid to create an SE template, added the hybrid level variables from the specified vertical coordinate file, used interpic from cam/tools/interpic_new to interpolate the initial conditions from the FV grid to the SE grid, and finally renamed the wind variables from US/VS to U/V to conform to the SE format.

I really appreciate you pointing me towards the convert_fv2se script in the MUSICA-Tools repository, and I’ll keep an eye out for updates.

Many thanks
 
Top