MODFLOW-USGS / mfusg

Public repository for MODFLOW-USG
https://water.usgs.gov/ogw/mfusg/
7 stars 4 forks source link

CLN storage initialization bug #30

Closed sorab closed 7 years ago

sorab commented 7 years ago

One more bug: In CLN2BAS1.f, we read IFLIN and change it to -1 if it is zero (line 239). That is fine. However, in Subroutine CLN2BAS1AR where we calculate initial saturated thickness, we use zero for IFLIN there also when it should be (less than or equal to zero). The line IF(IBOUND(N).NE.0.AND.IFLIN.EQ.0) THEN should be changed to the line below: IF(IBOUND(N).NE.0.AND.IFLIN.LE.0) THEN Will send test problem

sorab commented 7 years ago

Same issue - another thing needs fixing. For angled pipes, ACLNCOND gets used before it is dimensioned. This part needs to be moved in Subroutine SDIS2CLN1AR. It is under comment 11A. Everything under comment 11A should be commented out as:

C11A--------FOR ANGLED PIPE, IF DEPTH OF FLOW IS LESS THAN DIAMETER MAKE HORIZONTAL c IF(IFDIR.EQ.2)THEN c FDPTH = FLENG SIN(FANGLE) c IC=IFTYP c CALL CLNR(IC,FRAD) c IF(FDPTH.LT.2.0FRAD) IFDIR = 1 c ENDIF

Then, before the RETURN, this is done (check on diameter which needs ACLNCOND), as:

C---------------------------------------------------------------------------------------- C11A-------FOR ANGLED PIPE, IF DEPTH OF FLOW IS LESS THAN DIAMETER MAKE HORIZONTAL DO I = 1,NCLNNDS IFTYP = ACLNNDS(I,2) IFDIR = ACLNNDS(I,3) FLENG = ACLNNDS(I,4) FANGLE = ACLNNDS(I,6) IF(IFDIR.EQ.2)THEN FDPTH = FLENG SIN(FANGLE) IC=IFTYP CALL CLNR(IC,FRAD) IF(FDPTH.LT.2.0FRAD) IFDIR = 1 ENDIF ENDDO C18-----RETURN RETURN END

(added the RETURN statement so you can see it is moved right before it. Needed to add the do-loop too here. Attaching fine to help debug. cln_mapped.zip

sorab commented 7 years ago

BTW, both these had made it into the USG-Beta version sometime earlier - probably when I was putting rectangular sections. I am a bit upset that I did not put it into the main version also. I should remember to bring these things along into LNF which I want to get restarted on in the next couple of weeks (before I forget all this again).

langevin-usgs commented 7 years ago

Verified that this change was made.