CMEPS icon indicating copy to clipboard operation
CMEPS copied to clipboard

trouble w/ the gust variables

Open jedwards4b opened this issue 1 year ago • 1 comments

          @jedwards4b I'm having trouble w/ the gust variables again. I've made this change
index ad2eda90..1678238d 100644
--- a/mediator/med_phases_aofluxes_mod.F90
+++ b/mediator/med_phases_aofluxes_mod.F90
@@ -1717,10 +1717,6 @@ end subroutine med_aofluxes_map_ogrid2xgrid_input
     call fldbun_getfldptr(fldbun, 'So_duu10n', aoflux_out%duu10n, xgrid=xgrid, rc=rc)
     if (chkerr(rc,__LINE__,u_FILE_u)) return

-    call fldbun_getfldptr(fldbun, 'So_ugustOut', aoflux_out%ugust_out, xgrid=xgrid, rc=rc)
-    if (chkerr(rc,__LINE__,u_FILE_u)) return
-    call fldbun_getfldptr(fldbun, 'So_u10withGust', aoflux_out%u10_withGust, xgrid=xgrid, rc=rc)
-    if (chkerr(rc,__LINE__,u_FILE_u)) return
     call fldbun_getfldptr(fldbun, 'So_u10res', aoflux_out%u10res, xgrid=xgrid, rc=rc)
     if (chkerr(rc,__LINE__,u_FILE_u)) return
     call fldbun_getfldptr(fldbun, 'Faox_taux', aoflux_out%taux, xgrid=xgrid, rc=rc)
@@ -1752,8 +1748,12 @@ end subroutine med_aofluxes_map_ogrid2xgrid_input
     if (add_gusts) then
        call fldbun_getfldptr(fldbun, 'So_ugustOut', aoflux_out%ugust_out, xgrid=xgrid, rc=rc)
        if (chkerr(rc,__LINE__,u_FILE_u)) return
+       call fldbun_getfldptr(fldbun, 'So_u10withGust', aoflux_out%u10_withGust, xgrid=xgrid, rc=rc)
+       if (chkerr(rc,__LINE__,u_FILE_u)) return
+
     else
        allocate(aoflux_out%ugust_out(lsize)); aoflux_out%ugust_out(:) = 0._R8
+       allocate(aoflux_out%u10_withGust(lsize)); aoflux_out%u10_withGust(:) = 0._R8
     end if

   end subroutine set_aoflux_out_pointers

Which I think I can fix. It seems the last gust PR created a duplicate line for getting the So_ugustOut fldptr. But I think putting them both inside the use_gusts works.

I'm not sure what to do with the So_u10res pointer. Is that always used regardless of whether gusts are included or not?

Originally posted by @DeniseWorthen in https://github.com/ESCOMP/CMEPS/issues/447#issuecomment-2030643694

jedwards4b avatar Apr 01 '24 23:04 jedwards4b

@DeniseWorthen I've opened a new issue for this - I really don't understand why you are posting it to #447 since that PR has nothing to do with wind gusts.

jedwards4b avatar Apr 01 '24 23:04 jedwards4b