This exchange concerned a problem and fix for MM5V2 on the T3E. MM5V3 is not affected. Thanks to David Wong at U.S. EPA. -Rotang -----Original Message----- From: John Michalakes [SMTP:michalak@mmm.mmm.ucar.EDU] Sent: Monday, December 13, 1999 10:24 AM To: wong.david-c@epa.gov Cc: michalak@ucar.edu Subject: Re: MM5 questions Dear David, Thank you very much for your very detailed message. This makes it very easy for me to help you. You are correct in your assessment of the problem and this is indeed a bug in MM5v2. I believe that the way to fix this is to make the following modification to param.F, which will ensure that the value of IBMOIST is broadcast to all processors once it has been calculated on processor zero using the settings in MIFC: C 24JUN97.45 C PARAM.788 C SET IBMOIST FOR 1-WAY RUN PARAM.789 C PARAM.790 IBMOIST=0 PARAM.791 IF(MIFC(1,1)(1:4).EQ.'1WAY')THEN PARAM.792 NUM3D=MIF(201,5) PARAM.793 DO L=1,NUM3D PARAM.794 IF(MIFC(204+L,5)(1:8).EQ.'CLW ')IBMOIST=1 PARAM.795 IF(MIFC(204+L,5)(1:8).EQ.'ICE '.AND.IICE.NE.1)THEN PARAM.796 PRINT *,'IICE=0 BUT INPUT FIELDS CONTAIN ICE, SET IICE=1' PARAM.797 STOP PARAM.798 ENDIF PARAM.799 IF(MIFC(204+L,5)(1:8).EQ.'GRAUPEL '.AND.IICEG.NE.1)THEN PARAM.800 PRINT *,'IICEG=0 BUT INPUT FIELDS CONTAIN GRAUPEL, ', PARAM.801 1 'SET IICEG=1' PARAM.802 STOP PARAM.803 ENDIF PARAM.804 ENDDO PARAM.805 ENDIF PARAM.806 #ifdef MPP1 CALL RSL_MON_BCAST( IBMOIST, IWORDSIZE ) #endif IF(SAVFRQ.LT.1.E-10)SAVFRQ=99999. PARAM.807 IF(TAPFRQ.LT.1.E-10)TAPFRQ=99999. PARAM.808 IF(PRTFRQ.LT.1.E-10)PRTFRQ=99999. PARAM.809 DT=TISTEP+1.E-10 PARAM.810 To answer your specific questions, (1) yes, IBMOIST must be 1 on all the processors and this fix should ensure that. And (2), the reason for the #ifndef T3E around the calls to RSL_MON_BCAST in mpp_param_10.incl is because MIFC and MRFC are both arrays of character strings and it is very difficult to pass character strings from Fortran to C routines on the Cray. The RSL_MON_BCAST routine is a C routine in the RSL library, and it was quite difficult to make this work correctly for the MIFC and MRFC character string arrays on the T3E. The fix above accomplishes the broadcast of the information once it has been converted to an integer. Could you try this out, please, and let me know if that solves the problem? I'll put the fix on the Helpdesk page. Best regards, and thanks again for the thorough description of the problem. John >Date: Mon, 13 Dec 1999 10:11:26 -0500 >From: David Wong >Subject: MM5 questions > >[...] >ran into problem (floating point exception in mprdinit.F) when running >MM5 1-way nested. Here is the observations of my investigation: The >crash was due to a negative number is fed into ALOG function: > > T0(I,J,K)=TS0+TLP*ALOG(PR0(I,J,K)/P0) > >where I = 24, J = 33, K = 21, PR0(I,J,K) = -189.7315..., P0 = 100000. >and PR0(I,J,K) was computed from the following line: >PR0(I,J,K)=PS0(I,J)*A(K)+(PTOP*1000.) where PS0(I,J) = >-11321.923965241183, A(K) = 0.89999999999999858, PTOP = 10. > >I accidentally set IBMOIST = 1, the code ran fine without crashing (I >did not check for correctness of the answer). I looked at the source >code, all the variables which are read within that (IBMOIST.EQ.1) >segment of code has nothing to do with the calculation mentioned above. >The only thing I can think of is there is memory allocation problem or >the file pointer is not advanced correctly because of skipping a big >segment of code (I have not studied the structure of the input and I am >new to MM5. I took over Al's responsibility about three weeks ago and I >still in the process of learning the entire structure of MM5). Anyway, >I examined the code along the line of IBMOIST not being set to 1. >IBMOIST is being set in param.F, however, it depends on MIFC which is >read in mpp_param_10.incl called by mm5.F. The boardcast of MIFC is >done when T3E is not defined. To run the MM5 1-way nested, Al added >some more stuff which included setting T3E flag, in the script. The T3E >flag is set in the script, but the code, mpp_param_10.inc is looking >for none T3E to boardcast MIFC and MRFC. I did an experiment by >changing #ifndef to #ifdef in mpp_param_10.inc but the execution was > > crashed in RSL_MON_BCAST -> MPI_Recv -> BCC_HANDLER. > >If you don't mind, could you help me to clarify the following questions? > > 1. should IBMOIST be 1 in all PEs in mprdinit.F? > 2. what was the original intention to have #ifndef in > mpp_param_10.incl > >Thanks for your help. I could be reached at 919-541-3400 or email. At >the mean time, I will look into the cause of the crash in >RSL_MON_BCAST. > >Regards, >David Wong > > >-- > > .-. .-. Cheung (David) Wong > / \ / \ Sr. Sci. Application Consultant > / / \ _ _ / \ \ Lockheed Martin Technical Services > / / / \(. .)/ \ \ \ US EPA MD/24 ERC-119 > //// // ' V ` \\ \\\\ RTP, NC 27711 > //// / / /: :\ \ \ \\\\ 919-541-3400 919-541-0056 (fax) > // / //` '\\ \ \\ wong.david-c@epa.gov > // //. .\\ \\ > / ---M---M--- \ "I took the road less traveled and > '/|||\` that has made all the difference." > '!` -- Robert Frost > >