This file was initiated on Nov.23, 1992. Aug. 5, 1993 Z0B has been set to the constant, 0.01. Sept.13,1993 Priscilla Newberger and John Allen have encountered a coastal model problem wherein the model began to blow up after running 4 to 6 days. Priscilla then found that by essentially making an additional call to ADVU and ADVV to create an updated ADVUU and ADVVV before executing the external mode, the problem was solved. Though we have not encountered the problem here at Princeton, the OSU experience indicates that the model needs fixing and in any event it is an opportunity to make it more robust. The changes listed below are substantial (Sorry); they incorporate Priscilla's main idea, but also some other changes that I think will make the code more consistant and readable. 1. Delete SUBROUTINEs ADVU and ADVV fron code. 2. Add new SUBROUTINEs ADVCT, ADVU and ADVV from the revised pom.f 3. In SUBROUTINE BAROPG, shorten arguement list to (DRHOX,DRHOY) and delete DO 569 and DO 570 loops. The remaining changes are in PROGRAM MAIN 4. Add ADVX(IM,JM,KB),ADVY(IM,JM,KB) to dimension statement in PROGRAM MAIN 5. Move DO 87 loop to position before ENDIF which is before DO 399 loop 6. After DO 100 loop and before DO 87 loop, add CALL ADVAVE (ADVUA,ADVVA,MODE). 7. At 2 places, shorten arguement of CALL BAROPG to (DRHOX,DRHOY) 8. Add CALL ADVCT(ADVX,ADVY) before CALL BAROPG(DRHOX,DRHOX) and after IF(MODE.... statement. 9. Replace DO 96 and DO 100 loops with those in pom.f. 10. Shorten arguements of CALL ADVU and CALL ADVV to (DRHOX,ADVX,DTI2) and (DRHOY,ADVY,DTI2) respectively. Unfortunately a new 3-D variable is defined. If you are hard up for memory I think that you can repeat CALL ADVCT before CALL ADVU and CALL ADVV and EQUIVALENCE (ADVX,UF),(ADVY,VF). Sept. 14, 1993 Delete Do 161 loop in SUBROUTINE BCOND. Add KEND=4 as first executable statement in SUBROUTINE EPRXYZ. Sept. 25, 1993 In the course of diagnosing the heat and salinity budget of pom calculations for the Mediterranean, I found a leak, a small one but a leak nonetheless. The problem was located in SUBROUTINE PROFT; it was related to the radiative penetration code (NBC=1 was OK). The revised PROFT now in pom.f should be OK. I suggest everyone swap PROFTs. Oct 1, 1993 In PROFT, SWRAD was not dimensioned. It is now. Jan 10, 1994 Allan Blumberg notes that in subroutine ADVQ,"The AAM needs to be averaged over the vertical(K) to put it at the same depth as Q. This fix doesn't make much of a difference, but what the heck." Done. March 31, 1994 In PROFT, the vertical diffusion and the radiation (for temperature) were done in two steps. The intermediate temperature is (normally) not saved so it is difficult to do a post process inter-layer, heat balance. There is now a revised PROFT in pom.f wherein diffusion and radiation are done simulutaneously. The code is somewhat simpler and post processing should be possible. I haven't tried the latter yet, but the change did not make a significant change in the final numbers in the case that I ran. Some people are nervous about reaching out of bounds in DO loops (a strategy invoked to obtain automatic vectorization on the Cyber 205). I have now changed most of DO loop limits so that they are "legal". The changes did not change calculated results. May 15, 1994 In response to user request, the temperature and salinity biases are declared at the beginning of the code as TBIAS and SBIAS which are now included in comblk.h. These variables replace 10. and 35. respectively in DENS and PROFQ; note also that a factor (SR-0.) and (SP-0.) becomes (SR-35.) and (SP-35.) in those two subroutines (a source of confusion; the latter 35.'s are part of the density formulas but could be confused with the salinity bias). DENS has been simplified; it still vectorizes on the YMP. Possibly, some users will prefer the old style; if not simply swap subroutines in which case,two CALL DENS statements in MAIN must have arguements. The variable, NBC, has been declared in the begining of the code. It is used as a control arguement in PROFT. The initial temperature profile for the sample problem has been altered. It gives nearly the same profile for H = constant, but should now be more sensible for H not= constant. Nov. 1, 1994 To achieve vectorization on the Cyber 205, it was prudent to fill all inner loops. The result was that variables on the right side of expressions grabbed out of range data; no problem, the overwritten boundary conditions fixed everything. However, this confused some of the good programmers out there and I have been slowly fixing the code so that it was legal (recently, some compilers have also complained). Very recently, Dr. Badal Pal obtained a listing of the remaining offending code so that, now, I think all is legal in pom.f. Here is Dr. Pal's list of out-of-bound I,J loops: 1. Loop 400: in program main both I and J are out of bound. 2. Loop 450: in program main both I and J are out of bound. 3. Loop 140, Subroutine ADVU: I index out of bound 4. Loop 140, Subroutine ADVV: J index out of bound 5. Loop 9006, Subroutine FINDPSI: I index out of bound 6. Loop 102 , Subroutine PROFU: J index out of bound 7. Loop 100, Subroutine VERTVL: I index out of bound 8. Loop 710, Subroutine VERTVL: I index out of bound 9. In subroutine VORT (no loop #), I index in 1St do loop is out of bound. Mar. 30 1995 Zhenjiang Li found an error in SUBROUTINE BCOND. In the external mode B.C.'s, DTI should be replaced by DTE. This had been corrected in our working models at Princeton, but since it is commented out in pom.f, it went unattended. May 22, 1995 Clark Rowley of U.R.I. recommends extending the range of the DO 300, 302, 303 and 304 loops in PROGRAM MAIN from JMM1 to JM. This accomodates open boundary conditions he is using but should have no impact on open boundary conditons cited in SUBROUTINE BCOND (commented out) of pom.f. The change has been made. June 20, 1996 The following changes are incorporated into pom96.f; the code "include"s comblk96.h. The FORTRAN names, TMEAN, SMEAN have been changed to TCLIM, SCLIM in order to distinquish their function from that of RMEAN. Also, change arguement names in CALL ADVT. In subroutine ADVT, change FMEAN to FCLIM. The names, TRNU, TRNV have been changed to DRX2D, DRY2D and ADVUU, ADVVV to ADX2D, ADY2D to more clearly indicate their function. DTE and ISPLIT are now declared by the user in MAIN instead of DTI and ISPLIT. The rationale is that one can first settle on DTE by use of MODE = 2 and then ISPLIT can be maximized experimentally under MODE = 3. Instead of a wind driven, closed basin, pom96.f now solves the problem of the flow through a channel which includes a seamount or an island and subroutine BCOND contains only active open boundary conditions. A new subroutine SLPMIN is now included and called by MAIN. It's use is somewhat experimental and can be excluded for many flow cases. Check the subroutine for description. The basis for the subroutine will be found in Mellor et al. (1994, J. Atmos. and Oceanic Tech., 11, 1126-1134). A revised user's guide is now available. June 30, 1996 The first use of CALL DENS has a wrong order of arguements. The second useage in the main internal loop is OK. pom96.f has been amended. Aug. 3, 1996 There was an error in S.R. BCOND pointed out by Marco Zavatarelli. After DO 220 and the U1 and U2 definitions, change the first U1 to U2 in the UF and VF= statements. pom96.f has been corrected. Aug. 6, 1996 Another error in S.R. BCOND discovered by Andres Sepulveda. After 2 lines after DO 295 J=1,IM, change UF(I,1,K)=1.E-10 VF(I,1,K)=1.E-10 to UF(1,J,K)=1.E-10 VF(1,J,K)=1.E-10 Aug. 20, 1996 Alas another error in pom96.f. Jose de Bettencourt notes that DT is not defined before use in the first call to subroutine DENS (after the DO 15 loop). It is now defined in the DO 30 loop. Sept. 12, 1996 Two Oregon Staters have unearthed two errors: the initial definition of DT has been moved to the DO 45 loop since H(I,J) is changed a little by S.R. SLPMIN. In S.R. PROFT, in DO 102 loop, DZ(K) should be DZ(KBM1). Fortuitously, the value, K=KBM1, was left over from the previous loop, at least on a CRAY. Dec. 24, 1996 In MAIN, swapped 360 CONTINUE and CALL DENS. March 5, 1997 I have determined a correction to the standard open BCs for T & S in S.R. BCOND which corrected a problem. Inspired by Steve Brenner's e-mail message which invoked Orlanski for the internal normal velocities, I also tried Orlanski's scheme. But I found that, for the seamount problem, one must still do something about T & S. Thus you will find Orlanski's BCs for T & S which, however, had to be modified as noted in S.R BCONDorl. There are now two subroutines in pom97.f. Try them both. Included in PROFQ is a modification detailed in the report by Arne Melsom (Realistic near-surface momentum mixing in the Princeton Ocean Model). I suggest you swap PROFQs. You will also find that the diffusivity has been set to zero by setting TPRNI=0. The model seems to work nicely as tested in several applications in addition to the seamount problem. This obviates the need for TCLIM and SCLIM but I have left those variables in the code for the time being. At the beginning of S.R. ADVCT, there is a small change to initialize CURV. If there are still problems with undefined variables for some machines, one might try Bill O'Connors subroutine to initialize variables in tote. Large numbers of data statements make for large object codes, I'm told. The modified code is called pom97.f I have inserted my runscript in the main ftp directory which, if used, will have to be modified by each user. I have also included a postscript file for temperature contours and velocities at 2000m of the seamount problem using the revised BCOND. The code, plxyvec.f and runscript, runpl, that did the plotting is in the directory, contrib_code. March 18, 1997 UBE and UBW, used by BCONDorl was not inititialized. It is now inititialized in MAIN as revealed by a search of those variables. May 9, 1997 Two developments have occurred: 1. PROGRAM MAIN has been reconfigured so that the code can comfortably run the ready-to-run seamount problem (SEAMT=.TRUE.) or a user defined problem (SEAMT=.FALSE) wherein a file corresponding to the READ(40) instruction must be provided by the user. 2. A more complete suite of lateral open boundary conditions has been provided. The open boundary conditions are closed by design of the masks, FSM, DUM and DVM. Additional comments have been provided. The variable, the Craybeen eliminated and replaced by 1/DZ where necessary. (For some time, the model blew up until I belatedly discovered I was using the seamount DZR instead of my "user defined problem" DZR.) pom97.f now "includes" the file comblk97.h. The users guide is in need of revision, but I don't know when I will able to do it. November 14, 1997 S.R DENS, at the suggestion of users, has been revised to speed it up. On the CRAY T90, only a 1% decrease in overall cpu time. December 22, 1997 The modification of PROFQ described under the March 5, 1997 change has caused problems. The modification was to set the length scale equal to kappa*(z relative to top or bottom) at the first grid from the top or bottom. Oftentimes the bottom boundary is not well resolved so that the length scale can be large or even very large; e.g., for a bottom layer thickness of 500 m, the length scale at the first grid from the bottom would be 200 m. The problems encountered by Arne Melsom at the surface should not occur at the bottom (I think) so that the code has been restored to the original version at the bottom; i.e., set the length scale equal to zero at the bottommost grid point. In S.R. BCOND, the internal velocity boundary conditions did not relate correctly to the commented east, west, north, south designation. They do now. December 31,1997 S.R. DEPTH has been simplified and is more understandable. February 12,1998 Dithering around with S.R. PROFQ never seems to end. Due to a mis- understanding of Arne Melsom's study, extra code, potentially harmful, was left in the code. Check the DO 180 loop for deletion of several lines of code. October 13, 1998 In PROGRAM MAIN, the DO 30 and DO 35 loops were redundant and have been removed. December 14, 1998 As noted by Wade Oberpriller, the location of SLPMIN renders it null since FSM=0. CALL SLPMIN has been moved down in the code but then commented out for the seamount problem. The subroutine might be useful in other problems where the topographical slopes might be overly large. June 4, 1999 Some housekeeping whereby the seamount geometry and boundary conditions are confined to a subroutine. This should make it easier for the user to visualize moving forward to the user's application. June 24, 1999 Prof. Robin Lardner points out that accuracy can be improved in S.R. DENS by changing the constant 999.842594 to 0.157406 and deleting the value 1000. in the expression for RHOO. These changes have been made in pom97.f. They may be important when running with 32 bit arithmetic. April 6, 2000 A user spotted an error in the above change in S.R. DENS, namely a sign mistake. The error is benign in that density was off by a small constant and the model only uses gradients of density. The error has been corrected. July 25, 2000 A basic change has been made in the M-Y turbulence closure model, and is implemented in S.R. PROFQ via the parameter STF which essentially makes the dissipation terms sensitive to the Richardson like parameter, GH. A paper which explains all of this, "One Dimensional, Ocean Surface Layer Modeling, a Problem and a Solution", may be downloaded from the pom web page, www.aos.princeton.edu/WWWPUBLIC/htdocs.pom A change has also been made to S.R. PROFT. Instead of absorbing some of the short wave radiation as a surface boundary condition, all of the radiation is now included in the radiative flux divergence term. This improves the very near surface diurnal temperature variations and also simplifies the code conceptually. The model with these changes is called pom98.f (reserving a possible pom00.f for bigger changes). Established users should be able to swap S.R. PROFQ and S.R. PROFT into their programs with (I hope) no trauma. July 31, 2000 Thanks to Dong Ko who points out that GH should be deleted from the EQUIVALENCE(DTEF,CC,GH) statement in S.R. PROFQ. Hope the new changes above have not introduced any other errors. October 16, 2000 The statement, AAM(I,J,K)=500., has been added to the DO 52 loop.