ESCOMP / CMEPS

NUOPC Community Mediator for Earth Prediction Systems
https://escomp.github.io/CMEPS/
24 stars 79 forks source link

med_methods_mod LOGMSG questions #390

Closed jedwards4b closed 1 year ago

jedwards4b commented 1 year ago

@mvertens

I have a case in which I get a failure at line 1399 of med_methods_mod.F90 because both lranki and lranko are 0. I think maybe this case should not be an error.

jedwards4b commented 1 year ago

I tried a change

diff --git a/mediator/med_methods_mod.F90 b/mediator/med_methods_mod.F90
index d510e64..649c9c5 100644
--- a/mediator/med_methods_mod.F90
+++ b/mediator/med_methods_mod.F90
@@ -1354,7 +1354,10 @@ contains
         call med_methods_Field_GetFldPtr(lfield, fldptr1=dataptro1, fldptr2=dataptro2, rank=lranko, rc=rc)
         if (chkerr(rc,__LINE__,u_FILE_u)) return

-        if (lranki == 1 .and. lranko == 1) then
+        if (lranki == 0 .and. lranko == 0) then
+           ! do nothing
+          call ESMF_LogWrite(trim(subname)//": Both ranki and ranko are 0", ESMF_LOGMSG_INFO)
+        elseif (lranki == 1 .and. lranko == 1) then

And it appears to work correctly.

mvertens commented 1 year ago

@jedwards4b - Good fix. What caused the lranki=lranko=0? Can you issue a PR with this fix?

jedwards4b commented 1 year ago

I was scaling PFS.ne30pg3_t232.BLT1850_v0c.derecho_intel and it did this when I ran NTASKS_ATM=5400 yes I will have a PR soon.

mvertens commented 1 year ago

Thanks!