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

Passing wind stress from mediator to wav component

paulhall

Paul Hall
Member
I'm not sure this is necessarily the best forum for this question, but I am working on a modification to WW3 that would make use of wind stress calculated in the mediator. Does anyone have advice (or documentation) on how to pass fluxes (e.g., something like Foxx_taux and Foxx_tauy) from the mediator to the wave component?

I have been able to modify esmFldsExchange_cesm_mod.F90 and fd_cesm.yaml in CMEPS to pass state variables from the mediator to the wave component, but fluxes appear to work differently. I have been following the online docs for CMEPS, but the wave component seems to be set up somewhat differently than the other components, and the options described in the docs don't seem to work. In particular, ifrac and ofrac aren't defined for the wave component in med_fractions_mod.F90.

Any pointers or suggestions would be appreciated. Thanks!
 

paulhall

Paul Hall
Member
Thanks! I think I'm a little behind the times. I first started exploring this last spring, and I build on tag = dev/unified_220202. For completeness, I have been using cesm2_3_beta11 and the GMOM_JRA_WD compset.
 

paulhall

Paul Hall
Member
Yeah, this was exactly my thought too. However, when I tried implementing a stress merge to wav using Foxx_taux as a template I ran into issues related to (as best I can tell) the fact that ofrac and ifrac aren't included in fraclist_w in med_fraction_mod.F90, and simply adding them to fraclist_w didn't seem to fix things (and may have created problems of its own... I'll have to go back and check).

Your impression, though, is that this is the way to go (i.e., create a stress merge to wav)? If nothing else it would be good to know that I'm not missing a simpler option.
 

paulhall

Paul Hall
Member
Thanks! I appreciate it. In the meantime, I will go back and see if I can find (or recreate) the error I was getting when I tried adding ifrac and ofrac.
 

MarianaV

Mariana Vertenstein
New Member
Hi Paul,

I'm happy to help with this as well. If you have a branch for CMEPS that you could share with us so along with a case that we can run to duplicate your error that would be very helpful.

Mariana
 

paulhall

Paul Hall
Member
Hi Mariana,

Of course! Here is my fork of the CMEPS repo. I have been using the "theorywaves" branch for this.

You can find an example on Cheyenne at

CASEDIR: /glade/u/home/paulhall/work/cases/g.23b11.GMOM_JRA_WD.tw.007
RUNDIR: /glade/u/home/paulhall/scratch/g.23b11.GMOM_JRA_WD.tw.007/run
ARCHIVE: /glade/u/home/paulhall/scratch/archive/g.23b11.GMOM_JRA_WD.tw.007

For this particular case, I have created the variable Fwxx_taux (in fd_cesm.yaml and esmFldsExchange_cesm_mod.F90) as an analog to Foxx_taux. I also added ifrac and ofrac to fraclist_w in med_fraction_mod.F90 (without this, the run hangs with errors in the the PETxxx_ESMF_LogFiles the effect of PET054 med_merge_mod.F90:359 (med_merge_mod: med_merge_auto_field): error ifracis not in FBw).

This case actually runs, and I can see Fwxx_taux in the cpl history files (as wavExp_Fwxx_taux), but the values are 0 everywhere (whereas ocnExp_Foxx_Taux has reasonable values).

Let me know if I can provide any more information on this. Thanks for your help!
 

paulhall

Paul Hall
Member
A related question about the WW3 code. When I first looked into using wind stresses within the wave component, it looked to me as though the WW3 code was already set up to import wind stresses from the mediator. In paticular, in wav_import_export.F90, it appears that atmospheric momentum fluxes (i.e., wind stresses) should are available to be imported from the mediator by simply setting inflags1(5)=true, with Faxa_taux being imported to UX0 and Faxa_tauy being imported to UY0. However, when I try setting inflags1(5)=true I appear to get 0's for UX0 and UY0. Does this portion of the code not functional?
 

MarianaV

Mariana Vertenstein
New Member
So I've created a new sandbox based on your Externals.cfg and duplcated your issue on cheyenne. It turns out that there are some hard-wired assumptions about atm/ocn fluxes that are in cmeps and I'm trying to figure out the best way forwards to have both the fields transferred to wav and make this more general. I'll talk to Jim about this as well. So the problem is in CMEPS - not in anything you are doing incorrectly!
 

paulhall

Paul Hall
Member
Thanks Mariana! This is very helpful. Let me know what you and Jim come up with. If I can help in any way, I am more than happy to. Just let me know.
 

MarianaV

Mariana Vertenstein
New Member
I have the Fwxx_taux no longer zero - but its not yet including the Fioi_taux. However it matches the Faox_taux. I have a few questions that I need to understand in order to put a general fix in that you can use. Would you be available for a chat? Today will probably not work - but I'm around tomorrow. I'll show Jim these changes also. My modified code is on cheyenne in ~/src/cesm.paulhall/components/cmeps/mediator/.
The key question I have is if you simply need to map Foxx_taux after it has been accumulated and averaged from the ocean to the wave grid and that would contain the Fwxx_taux data. If this is the case the it would be simply to just add a small block of code to the med_phases_prep_ocn_mod.F90 code to carry out this calculation. But I'm concerned that we have different averaging times for the ocean and the wav and potentially different lags - so I'm not sure about the best way to proceed. Alternatively we could simply do the mapping and averaging in the med_phases_prep_wav.
I'm also concerned that there is hard-wiring in place that assumes the wav and ocean are on the same grid. So we should talk about that as well.
In summary - lots of questions!
 

paulhall

Paul Hall
Member
Hi Mariana,

Of course! I can be available between 8:30-10:00am and or after 3:00pm (Eastern Time) tomorrow (12 May). Let me know if there is a window that works for you.

In general I think that just having Faox_taux should be sufficient, at least at this stage. How best to handle regions with sea ice is still an open question for us.

Thanks!
Paul
 

MarianaV

Mariana Vertenstein
New Member
Jim and I are already off and I have another meeting now and have to leave afterwards. I'll get you some code tonight that will have just the Fwxx_taux passed that will effectively be Faox_taux. We can then maybe touch base tomorrow. Let me know.
 

paulhall

Paul Hall
Member
Sorry to have missed you. This all sounds good. Happy to meet up tomorrow. Just let me know if there is a time that works for you.

Thanks for all of your help!
 

MarianaV

Mariana Vertenstein
New Member
Paul - I've send a meeting invite to you and Jim for 9ET/7MT today. I can make it later if that's too early for Jim. Also - have a look at the following:

New code:
/glade/u/home/mvertens/src/cesm.paulhall/components/cmeps/mediator
modified: esmFldsExchange_cesm_mod.F90
modified: med_phases_aofluxes_mod.F90
modified: med_phases_prep_wav_mod.F90

You can also see the coupler history output in the following files:
/glade/scratch/mvertens/g.23b11.GMOM_JRA_WD.tw.007/run
-rw-r--r-- 1 mvertens ncar 560814040 May 11 08:01 g.23b11.GMOM_JRA_WD.tw.007.cpl.hi.0001-01-01-03600.nc
-rw-r--r-- 1 mvertens ncar 560814040 May 11 08:02 g.23b11.GMOM_JRA_WD.tw.007.cpl.hi.0001-01-01-07200.nc
-rw-r--r-- 1 mvertens ncar 560814040 May 11 08:02 g.23b11.GMOM_JRA_WD.tw.007.cpl.hi.0001-01-01-10800.nc
-rw-r--r-- 1 mvertens ncar 560814040 May 11 08:02 g.23b11.GMOM_JRA_WD.tw.007.cpl.hi.0001-01-01-14400.nc
-rw-r--r-- 1 mvertens ncar 560814040 May 11 08:02 g.23b11.GMOM_JRA_WD.tw.007.cpl.hi.0001-01-01-18000.nc
-rw-r--r-- 1 mvertens ncar 560814040 May 11 08:03 g.23b11.GMOM_JRA_WD.tw.007.cpl.hi.0001-01-01-21600.nc
-rw-r--r-- 1 mvertens ncar 560814040 May 11 08:03 g.23b11.GMOM_JRA_WD.tw.007.cpl.hi.0001-01-01-25200.nc
-rw-r--r-- 1 mvertens ncar 560814040 May 11 08:03 g.23b11.GMOM_JRA_WD.tw.007.cpl.hi.0001-01-01-28800.nc
-rw-r--r-- 1 mvertens ncar 560814040 May 11 08:03 g.23b11.GMOM_JRA_WD.tw.007.cpl.hi.0001-01-01-32400.nc
-rw-r--r-- 1 mvertens ncar 560814040 May 11 08:04 g.23b11.GMOM_JRA_WD.tw.007.cpl.hi.0001-01-01-36000.nc

You can compare ocnExp_Foxx_taux and wavExp_Fwxx_taux (currently there is Fioi_taux being merged into the wave)
 
Top