Changeset 26544
- Timestamp:
- 11/04/21 16:26:20 (3 years ago)
- Location:
- issm/trunk-jpl/test/MITgcm
- Files:
-
- 1 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/MITgcm/code/CPP_EEOPTIONS.h
r23083 r26544 62 62 C Use D0 where it means REAL*8 but not where it means REAL*16 63 63 #define D0 d0 64 65 C-- Enable some old macro conventions for backward compatibility66 #undef USE_OLD_MACROS_R4R8toRSRL67 64 68 65 C=== IO related options === -
issm/trunk-jpl/test/MITgcm/code/do_oceanic_phys.F
r23083 r26544 1 1 #include "PACKAGES_CONFIG.h" 2 2 #include "CPP_OPTIONS.h" 3 #ifdef ALLOW_MOM_COMMON 4 # include "MOM_COMMON_OPTIONS.h" 5 #endif 3 6 #ifdef ALLOW_AUTODIFF 4 7 # include "AUTODIFF_OPTIONS.h" … … 73 76 C |-- EXTERNAL_FORCING_SURF 74 77 C | 78 C |-- OBCS_ADJUST 79 C | 75 80 C |- k loop (Nr:1): 76 81 C | - DWNSLP_CALC_RHO … … 119 124 C | 120 125 C |-- KPP_DO_EXCH 126 C | 127 C |-- GGL90_EXCHANGES 121 128 C | 122 129 C |-- DIAGS_RHO_G … … 143 150 #ifdef ALLOW_AUTODIFF 144 151 # include "AUTODIFF_MYFIELDS.h" 145 # include "tamc.h" 146 # include "tamc_keys.h" 152 # ifdef ALLOW_AUTODIFF_TAMC 153 # include "tamc.h" 154 # endif 147 155 # include "FFIELDS.h" 148 156 # include "SURFACE.h" … … 196 204 C !LOCAL VARIABLES: 197 205 C == Local variables 198 C rhoK , rhoKm1 :: Density at current level, and level above206 C rhoKp1,rhoKm1 :: Density at current level, and @ level minus one 199 207 C iMin, iMax :: Ranges and sub-block indices on which calculations 200 208 C jMin, jMax are applied. … … 202 210 C msgBuf :: Temp. for building output string 203 211 C i,j,k :: loop indices 212 C kSrf :: surface index 204 213 _RL rhoKp1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy) 205 214 _RL rhoKm1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy) … … 210 219 INTEGER jMin, jMax 211 220 INTEGER bi, bj 212 INTEGER i, j, k 221 INTEGER i, j, k, kSrf 213 222 CHARACTER*(MAX_LEN_MBUF) msgBuf 214 223 INTEGER doDiagsRho … … 221 230 _RL thetaRef 222 231 #endif /* ALLOW_AUTODIFF */ 232 #ifdef ALLOW_AUTODIFF_TAMC 233 INTEGER act1, act2, act3, act4 234 INTEGER max1, max2, max3 235 INTEGER kkey, itdkey 236 #endif 223 237 CEOP 224 238 … … 227 241 itdkey = 1 228 242 #endif /* ALLOW_AUTODIFF_TAMC */ 243 244 kSrf = 1 245 IF ( usingPCoords ) kSrf = Nr 229 246 230 247 #ifdef ALLOW_DEBUG … … 282 299 283 300 #ifdef ALLOW_AUTODIFF 284 # ifdef ALLOW_SALT_PLUME285 301 DO bj=myByLo(myThid),myByHi(myThid) 286 302 DO bi=myBxLo(myThid),myBxHi(myThid) 287 303 DO j=1-OLy,sNy+OLy 288 304 DO i=1-OLx,sNx+OLx 305 adjustColdSST_diag(i,j,bi,bj) = 0. _d 0 306 # ifdef ALLOW_SALT_PLUME 289 307 saltPlumeDepth(i,j,bi,bj) = 0. _d 0 290 308 saltPlumeFlux(i,j,bi,bj) = 0. _d 0 309 # endif 291 310 ENDDO 292 311 ENDDO 293 312 ENDDO 294 313 ENDDO 295 # endif296 # ifdef ALLOW_ECCO297 # ifdef ALLOW_SIGMAR_COST_CONTRIBUTION298 DO bj=myByLo(myThid),myByHi(myThid)299 DO bi=myBxLo(myThid),myBxHi(myThid)300 DO k=1,Nr301 DO j=1-OLy,sNy+OLy302 DO i=1-OLx,sNx+OLx303 sigmaRfield(i,j,k,bi,bj) = 0. _d 0304 ENDDO305 ENDDO306 ENDDO307 ENDDO308 ENDDO309 # endif310 # endif311 314 #endif /* ALLOW_AUTODIFF */ 312 315 … … 320 323 #endif /* ALLOW_FRAZIL */ 321 324 322 #ifndef OLD_THSICE_CALL_SEQUENCE323 325 #if (defined ALLOW_THSICE) && !(defined ALLOW_ATM2D) 324 326 IF ( useThSIce .AND. fluidIsWater ) THEN 325 327 # ifdef ALLOW_AUTODIFF_TAMC 326 CADJ STORE uice,vice = comlev1, key = ikey_dynamics, 327 CADJ & kind = isbyte 328 CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics, 329 CADJ & kind = isbyte 330 CADJ STORE snowHeight, Tsrf = comlev1, key = ikey_dynamics, 331 CADJ & kind = isbyte 332 CADJ STORE Qice1, Qice2 = comlev1, key = ikey_dynamics, 333 CADJ & kind = isbyte 334 CADJ STORE sHeating, snowAge = comlev1, key = ikey_dynamics, 335 CADJ & kind = isbyte 336 CADJ STORE hocemxl = comlev1, key = ikey_dynamics, 337 CADJ & kind = isbyte 338 CADJ STORE icflxsw = comlev1, key = ikey_dynamics, 339 CADJ & kind = isbyte 340 CADJ STORE salt,theta = comlev1, key = ikey_dynamics, 341 CADJ & kind = isbyte 342 CADJ STORE uvel,vvel = comlev1, key = ikey_dynamics, 343 CADJ & kind = isbyte 344 CADJ STORE qnet,qsw, empmr = comlev1, key = ikey_dynamics, 345 CADJ & kind = isbyte 346 CADJ STORE atemp,aqh,precip = comlev1, key = ikey_dynamics, 347 CADJ & kind = isbyte 348 CADJ STORE swdown,lwdown = comlev1, key = ikey_dynamics, 349 CADJ & kind = isbyte 328 # ifdef ALLOW_SEAICE 329 CADJ STORE uice,vice = comlev1, key=ikey_dynamics, kind=isbyte 330 # endif 331 CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte 332 CADJ STORE snowHeight, Tsrf = comlev1, key=ikey_dynamics, kind=isbyte 333 CADJ STORE Qice1, Qice2 = comlev1, key=ikey_dynamics, kind=isbyte 334 CADJ STORE sHeating,snowAge = comlev1, key=ikey_dynamics, kind=isbyte 335 CADJ STORE hocemxl, icflxsw = comlev1, key=ikey_dynamics, kind=isbyte 336 CADJ STORE salt,theta = comlev1, key=ikey_dynamics, kind=isbyte 337 CADJ STORE uvel,vvel = comlev1, key=ikey_dynamics, kind=isbyte 338 CADJ STORE qnet,qsw, empmr = comlev1, key=ikey_dynamics, kind=isbyte 339 CADJ STORE atemp,aqh,precip = comlev1, key=ikey_dynamics, kind=isbyte 340 CADJ STORE swdown,lwdown = comlev1, key=ikey_dynamics, kind=isbyte 350 341 # ifdef NONLIN_FRSURF 351 CADJ STORE hFac_surfC = comlev1, key = ikey_dynamics, 352 CADJ & kind = isbyte 342 CADJ STORE hFac_surfC = comlev1, key=ikey_dynamics, kind=isbyte 353 343 # endif 354 344 # endif /* ALLOW_AUTODIFF_TAMC */ … … 363 353 ENDIF 364 354 #endif /* ALLOW_THSICE */ 365 #endif /* ndef OLD_THSICE_CALL_SEQUENCE */366 355 367 356 #ifdef ALLOW_SEAICE 368 # ifdef ALLOW_AUTODIFF 369 CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte 370 CADJ STORE fu,fv = comlev1, key=ikey_dynamics, kind=isbyte 371 CADJ STORE qnet = comlev1, key=ikey_dynamics, kind=isbyte 372 CADJ STORE qsw = comlev1, key=ikey_dynamics, kind=isbyte 373 CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte 374 CADJ STORE salt = comlev1, key=ikey_dynamics, kind=isbyte 357 # ifdef ALLOW_AUTODIFF_TAMC 358 CADJ STORE qnet = comlev1, key=ikey_dynamics, kind=isbyte 359 CADJ STORE qsw = comlev1, key=ikey_dynamics, kind=isbyte 360 CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte 361 CADJ STORE salt = comlev1, key=ikey_dynamics, kind=isbyte 362 CADJ STORE fu,fv = comlev1, key=ikey_dynamics, kind=isbyte 375 363 #if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP) 376 CADJ STORE evap = comlev1, key=ikey_dynamics, kind=isbyte 377 #endif 378 IF ( .NOT.useSEAICE .AND. SEAICEadjMODE .EQ. -1 ) THEN 379 CALL SEAICE_FAKE( myTime, myIter, myThid ) 380 ENDIF 381 CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte 382 CADJ STORE fu,fv = comlev1, key=ikey_dynamics, kind=isbyte 383 CADJ STORE qnet = comlev1, key=ikey_dynamics, kind=isbyte 384 CADJ STORE qsw = comlev1, key=ikey_dynamics, kind=isbyte 385 CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte 386 CADJ STORE salt = comlev1, key=ikey_dynamics, kind=isbyte 387 #if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP) 388 CADJ STORE evap = comlev1, key=ikey_dynamics, kind=isbyte 389 #endif 390 # endif /* ALLOW_AUTODIFF */ 391 #endif /* ALLOW_SEAICE */ 392 393 #ifdef ALLOW_SEAICE 364 CADJ STORE evap = comlev1, key=ikey_dynamics, kind=isbyte 365 #endif 366 # endif /* ALLOW_AUTODIFF_TAMC */ 367 #ifdef ALLOW_AUTODIFF_TAMC 368 CADJ STORE phiHydLow= comlev1, key=ikey_dynamics, byte=isbyte 369 #endif 394 370 IF ( useSEAICE ) THEN 395 371 # ifdef ALLOW_AUTODIFF_TAMC 396 cph-adj-test( 397 CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte 398 CADJ STORE hsnow = comlev1, key=ikey_dynamics, kind=isbyte 399 CADJ STORE heff = comlev1, key=ikey_dynamics, kind=isbyte 400 CADJ STORE tices = comlev1, key=ikey_dynamics, kind=isbyte 401 CADJ STORE empmr, qnet = comlev1, key=ikey_dynamics, kind=isbyte 402 CADJ STORE qsw,saltflux = comlev1, key=ikey_dynamics, kind=isbyte 403 CADJ STORE fu, fv = comlev1, key=ikey_dynamics, kind=isbyte 404 cCADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte 405 cCADJ STORE salt = comlev1, key=ikey_dynamics, kind=isbyte 406 cph-adj-test) 407 c#ifdef ALLOW_EXF 408 CADJ STORE atemp,aqh,precip = comlev1, key = ikey_dynamics, 409 CADJ & kind = isbyte 410 CADJ STORE swdown,lwdown = comlev1, key = ikey_dynamics, 411 CADJ & kind = isbyte 412 CADJ STORE evap = comlev1, key = ikey_dynamics, 413 CADJ & kind = isbyte 414 CADJ STORE uwind,vwind = comlev1, key = ikey_dynamics, 415 CADJ & kind = isbyte 416 c#endif 417 CADJ STORE uvel,vvel = comlev1, key = ikey_dynamics, 418 CADJ & kind = isbyte 419 # ifdef SEAICE_CGRID 420 CADJ STORE stressdivergencex = comlev1, key = ikey_dynamics, 421 CADJ & kind = isbyte 422 CADJ STORE stressdivergencey = comlev1, key = ikey_dynamics, 423 CADJ & kind = isbyte 424 # endif 425 # ifdef SEAICE_ALLOW_DYNAMICS 426 CADJ STORE uice = comlev1, key = ikey_dynamics, 427 CADJ & kind = isbyte 428 CADJ STORE vice = comlev1, key = ikey_dynamics, 429 CADJ & kind = isbyte 430 CADJ STORE dwatn = comlev1, key = ikey_dynamics, 431 CADJ & kind = isbyte 432 # ifdef SEAICE_ALLOW_EVP 433 CADJ STORE seaice_sigma1 = comlev1, key = ikey_dynamics, 434 CADJ & kind = isbyte 435 CADJ STORE seaice_sigma2 = comlev1, key = ikey_dynamics, 436 CADJ & kind = isbyte 437 CADJ STORE seaice_sigma12 = comlev1, key = ikey_dynamics, 438 CADJ & kind = isbyte 439 # endif 372 CADJ STORE uvel,vvel = comlev1, key=ikey_dynamics, kind=isbyte 373 CADJ STORE uice,vice = comlev1, key=ikey_dynamics, kind=isbyte 374 # ifdef ALLOW_EXF 375 CADJ STORE atemp,aqh,precip = comlev1, key=ikey_dynamics, kind=isbyte 376 CADJ STORE swdown,lwdown = comlev1, key=ikey_dynamics, kind=isbyte 377 CADJ STORE uwind,vwind = comlev1, key=ikey_dynamics, kind=isbyte 440 378 # endif 441 379 # ifdef SEAICE_VARIABLE_SALINITY 442 CADJ STORE hsalt = comlev1, key = ikey_dynamics, 443 CADJ & kind = isbyte 380 CADJ STORE hsalt = comlev1, key=ikey_dynamics, kind=isbyte 444 381 # endif 445 382 # ifdef ATMOSPHERIC_LOADING 446 CADJ STORE pload = comlev1, key = ikey_dynamics, 447 CADJ & kind = isbyte 448 CADJ STORE siceload = comlev1, key = ikey_dynamics, 449 CADJ & kind = isbyte 383 CADJ STORE pload, siceload = comlev1, key=ikey_dynamics, kind=isbyte 450 384 # endif 451 385 # ifdef NONLIN_FRSURF 452 CADJ STORE recip_hfacc = comlev1, key = ikey_dynamics, 453 CADJ & kind = isbyte 386 CADJ STORE recip_hfacc = comlev1, key=ikey_dynamics, kind=isbyte 454 387 # endif 455 388 # ifdef ANNUAL_BALANCE 456 CADJ STORE balance_itcount = comlev1, key = ikey_dynamics, 457 CADJ & kind = isbyte 389 CADJ STORE balance_itcount = comlev1, key=ikey_dynamics, kind=isbyte 458 390 # endif /* ANNUAL_BALANCE */ 459 391 # ifdef ALLOW_THSICE 460 C-- store thSIce vars before advection (called from SEAICE_MODEL) update them: 461 CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics, 462 CADJ & kind = isbyte 463 CADJ STORE snowHeight, hOceMxL = comlev1, key = ikey_dynamics, 464 CADJ & kind = isbyte 465 CADJ STORE Qice1, Qice2 = comlev1, key = ikey_dynamics, 466 CADJ & kind = isbyte 392 C-- store thSIce vars before advection (called from SEAICE_MODEL) updates them: 393 CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte 394 CADJ STORE snowHeight,hOceMxL= comlev1, key=ikey_dynamics, kind=isbyte 395 CADJ STORE Qice1, Qice2 = comlev1, key=ikey_dynamics, kind=isbyte 467 396 # endif /* ALLOW_THSICE */ 468 397 # endif /* ALLOW_AUTODIFF_TAMC */ … … 473 402 CALL SEAICE_MODEL( myTime, myIter, myThid ) 474 403 CALL TIMER_STOP ('SEAICE_MODEL [DO_OCEANIC_PHYS]', myThid) 404 # ifdef ALLOW_AUTODIFF_TAMC 405 CADJ STORE tices = comlev1, key=ikey_dynamics, kind=isbyte 406 CADJ STORE heff = comlev1, key=ikey_dynamics, kind=isbyte 407 CADJ STORE hsnow = comlev1, key=ikey_dynamics, kind=isbyte 408 CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte 409 CADJ STORE uIce = comlev1, key=ikey_dynamics, kind=isbyte 410 CADJ STORE vIce = comlev1, key=ikey_dynamics, kind=isbyte 411 # endif 475 412 # ifdef ALLOW_COST 476 413 CALL SEAICE_COST_SENSI ( myTime, myIter, myThid ) 477 414 # endif 415 # ifdef ALLOW_AUTODIFF 416 ELSEIF ( SEAICEadjMODE .EQ. -1 ) THEN 417 CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte 418 CALL SEAICE_FAKE( myTime, myIter, myThid ) 419 # endif /* ALLOW_AUTODIFF */ 478 420 ENDIF 479 421 #endif /* ALLOW_SEAICE */ … … 493 435 494 436 #ifdef ALLOW_AUTODIFF_TAMC 495 CADJ STORE sst, sss = comlev1, key = ikey_dynamics, 496 CADJ & kind = isbyte 497 CADJ STORE qsw = comlev1, key = ikey_dynamics, 498 CADJ & kind = isbyte 437 CADJ STORE sst, sss = comlev1, key=ikey_dynamics, kind=isbyte 438 CADJ STORE qsw = comlev1, key=ikey_dynamics, kind=isbyte 499 439 # ifdef ALLOW_SEAICE 500 CADJ STORE area = comlev1, key = ikey_dynamics, 501 CADJ & kind = isbyte 502 # endif 503 #endif 504 505 #ifdef OLD_THSICE_CALL_SEQUENCE 506 #if (defined ALLOW_THSICE) && !(defined ALLOW_ATM2D) 507 IF ( useThSIce .AND. fluidIsWater ) THEN 508 # ifdef ALLOW_AUTODIFF_TAMC 509 cph( 510 # ifdef NONLIN_FRSURF 511 CADJ STORE uice,vice = comlev1, key = ikey_dynamics, 512 CADJ & kind = isbyte 513 CADJ STORE salt,theta = comlev1, key = ikey_dynamics, 514 CADJ & kind = isbyte 515 CADJ STORE qnet,qsw, empmr = comlev1, key = ikey_dynamics, 516 CADJ & kind = isbyte 517 CADJ STORE hFac_surfC = comlev1, key = ikey_dynamics, 518 CADJ & kind = isbyte 519 # endif 520 # endif 521 # ifdef ALLOW_DEBUG 522 IF (debugMode) CALL DEBUG_CALL('THSICE_MAIN',myThid) 523 # endif 524 C-- Step forward Therm.Sea-Ice variables 525 C and modify forcing terms including effects from ice 526 CALL TIMER_START('THSICE_MAIN [DO_OCEANIC_PHYS]', myThid) 527 CALL THSICE_MAIN( myTime, myIter, myThid ) 528 CALL TIMER_STOP( 'THSICE_MAIN [DO_OCEANIC_PHYS]', myThid) 529 ENDIF 530 #endif /* ALLOW_THSICE */ 531 #endif /* OLD_THSICE_CALL_SEQUENCE */ 440 CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte 441 # endif 442 #endif 532 443 533 444 #ifdef ALLOW_CPL_ISSM … … 541 452 #endif 542 453 #ifdef ALLOW_AUTODIFF_TAMC 543 CADJ STORE salt, theta = comlev1, key = ikey_dynamics, 544 CADJ & kind = isbyte 545 CADJ STORE uvel, vvel = comlev1, key = ikey_dynamics, 546 CADJ & kind = isbyte 454 CADJ STORE salt, theta = comlev1, key=ikey_dynamics, kind=isbyte 455 CADJ STORE uvel, vvel = comlev1, key=ikey_dynamics, kind=isbyte 547 456 #endif 548 457 C compute temperature and (virtual) salt flux at the … … 574 483 IF ( useSALT_PLUME ) THEN 575 484 Catn: exchanging saltPlumeFlux: 576 485 CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid ) 577 486 ENDIF 578 487 #endif /* ALLOW_SALT_PLUME */ … … 581 490 IF ( allowFreezing ) THEN 582 491 #ifdef ALLOW_AUTODIFF_TAMC 583 CADJ STORE theta = comlev1, key = ikey_dynamics, 584 CADJ & kind = isbyte 492 CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte 585 493 #endif 586 494 CALL FREEZE_SURFACE( myTime, myIter, myThid ) … … 595 503 C relaxation terms, etc. 596 504 #ifdef ALLOW_AUTODIFF 597 CADJ STORE salt, theta = comlev1, key = ikey_dynamics, 598 CADJ & kind = isbyte 505 CADJ STORE salt, theta = comlev1, key=ikey_dynamics, kind=isbyte 599 506 #else /* ALLOW_AUTODIFF */ 600 507 C-- if fluid is not water, by-pass surfaceForcing, find_rho, gmredi … … 608 515 I iMin, iMax, jMin, jMax, 609 516 I myTime, myIter, myThid ) 517 518 #ifdef ALLOW_OBCS 519 IF (useOBCS) THEN 520 C-- After all surface fluxes are known apply balancing fluxes and 521 C-- apply tidal forcing to open boundaries 522 # ifdef ALLOW_DEBUG 523 IF (debugMode) CALL DEBUG_CALL('OBCS_ADJUST',myThid) 524 # endif 525 CALL OBCS_ADJUST( 526 I myTime+deltaTClock, myIter+1, myThid ) 527 ENDIF 528 #endif /* ALLOW_OBCS */ 610 529 611 530 #ifdef ALLOW_AUTODIFF_TAMC … … 645 564 sigmaY(i,j,k) = 0. _d 0 646 565 sigmaR(i,j,k) = 0. _d 0 566 #if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG)) 567 sigmaRfield(i,j,k,bi,bj) = 0. _d 0 568 #endif 647 569 ENDDO 648 570 ENDDO 649 571 ENDDO 650 572 651 #ifdef ALLOW_AUTODIFF652 573 DO j=1-OLy,sNy+OLy 653 574 DO i=1-OLx,sNx+OLx … … 656 577 ENDDO 657 578 ENDDO 579 #ifdef ALLOW_AUTODIFF 658 580 cph all the following init. are necessary for TAF 659 581 cph although some of these are re-initialised later. … … 697 619 Kwy(i,j,k,bi,bj) = 0. _d 0 698 620 Kwz(i,j,k,bi,bj) = 0. _d 0 699 # ifdef GM_NON_UNITY_DIAGONAL700 621 Kux(i,j,k,bi,bj) = 0. _d 0 701 622 Kvy(i,j,k,bi,bj) = 0. _d 0 702 # endif703 623 # ifdef GM_EXTRA_DIAGONAL 704 624 Kuz(i,j,k,bi,bj) = 0. _d 0 … … 736 656 737 657 #ifdef ALLOW_AUTODIFF_TAMC 738 CADJ STORE theta(:,:,:,bi,bj) = comlev1_bibj, key=itdkey, 739 CADJ & kind = isbyte 740 CADJ STORE salt (:,:,:,bi,bj) = comlev1_bibj, key=itdkey, 741 CADJ & kind = isbyte 658 CADJ STORE theta(:,:,:,bi,bj) = comlev1_bibj, key=itdkey, kind=isbyte 659 CADJ STORE salt (:,:,:,bi,bj) = comlev1_bibj, key=itdkey, kind=isbyte 742 660 CADJ STORE totphihyd(:,:,:,bi,bj) 743 CADJ & = comlev1_bibj, key=itdkey, 744 CADJ & kind = isbyte 661 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 745 662 # ifdef ALLOW_KPP 746 CADJ STORE uvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey, 747 CADJ & kind = isbyte 748 CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey, 749 CADJ & kind = isbyte 663 CADJ STORE uvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey, kind=isbyte 664 CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey, kind=isbyte 750 665 # endif 751 666 # ifdef ALLOW_SALT_PLUME 752 CADJ STORE saltplumedepth(:,:,bi,bj) = comlev1_bibj, key=itdkey,753 CADJ & kind =isbyte754 CADJ STORE saltplumeflux(:,:,bi,bj) = comlev1_bibj, key=itdkey,755 CADJ & kind =isbyte667 CADJ STORE saltplumedepth(:,:,bi,bj) 668 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 669 CADJ STORE saltplumeflux(:,:,bi,bj) 670 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 756 671 # endif 757 672 #endif /* ALLOW_AUTODIFF_TAMC */ … … 856 771 IF (k.GT.1) THEN 857 772 #ifdef ALLOW_AUTODIFF_TAMC 858 CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey, 859 CADJ & kind = isbyte 860 CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey, 861 CADJ & kind = isbyte 862 CADJ STORE rhokm1 (bi,bj) = comlev1_bibj_k, key=kkey, 863 CADJ & kind = isbyte 773 CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte 774 CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte 775 CADJ STORE rhokm1 (bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte 864 776 #endif /* ALLOW_AUTODIFF_TAMC */ 865 CALL FIND_RHO_2D( 777 IF ( usingZCoords ) THEN 778 DO j=jMin,jMax 779 DO i=iMin,iMax 780 rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj) 781 ENDDO 782 ENDDO 783 CALL FIND_RHO_2D( 866 784 I iMin, iMax, jMin, jMax, k, 867 785 I theta(1-OLx,1-OLy,k-1,bi,bj), … … 869 787 O rhoKm1, 870 788 I k-1, bi, bj, myThid ) 789 ELSE 790 CALL FIND_RHO_2D( 791 I iMin, iMax, jMin, jMax, k-1, 792 I theta(1-OLx,1-OLy,k,bi,bj), 793 I salt (1-OLx,1-OLy,k,bi,bj), 794 O rhoKp1, 795 I k, bi, bj, myThid ) 796 DO j=jMin,jMax 797 DO i=iMin,iMax 798 rhoKm1(i,j) = rhoInSitu(i,j,k-1,bi,bj) 799 ENDDO 800 ENDDO 801 ENDIF 871 802 ENDIF 872 803 #ifdef ALLOW_DEBUG 873 804 IF (debugMode) CALL DEBUG_CALL('GRAD_SIGMA',myThid) 874 805 #endif 875 cph Avoid variable aliasing for adjoint !!!876 DO j=jMin,jMax877 DO i=iMin,iMax878 rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)879 ENDDO880 ENDDO881 806 CALL GRAD_SIGMA( 882 807 I bi, bj, iMin, iMax, jMin, jMax, k, … … 884 809 O sigmaX, sigmaY, sigmaR, 885 810 I myThid ) 886 #ifdef ALLOW_ECCO 887 # ifdef ALLOW_SIGMAR_COST_CONTRIBUTION811 812 #if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG)) 888 813 DO j=jMin,jMax 889 814 DO i=iMin,iMax … … 891 816 ENDDO 892 817 ENDDO 893 # endif894 #endif /* ALLOW_ECCO */ 818 #endif /* ALLOW_SIGMAR_COST_CONTRIBUTION or ALLOW_LEITH_QG */ 819 895 820 #ifdef ALLOW_AUTODIFF 896 821 #ifdef GMREDI_WITH_STABLE_ADJOINT … … 929 854 #ifdef ALLOW_AUTODIFF_TAMC 930 855 CADJ STORE IVDConvCount(:,:,:,bi,bj) 931 CADJ & = comlev1_bibj, key=itdkey, 932 CADJ & kind = isbyte 856 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 933 857 #endif 934 858 … … 936 860 IF ( calcGMRedi .OR. MOD(doDiagsRho,2).EQ.1 ) THEN 937 861 CALL CALC_OCE_MXLAYER( 938 I rhoInSitu(1-OLx,1-OLy, 1,bi,bj), sigmaR,862 I rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR, 939 863 I bi, bj, myTime, myIter, myThid ) 940 864 ENDIF … … 943 867 IF ( useSALT_PLUME ) THEN 944 868 CALL SALT_PLUME_CALC_DEPTH( 945 I rhoInSitu(1-OLx,1-OLy, 1,bi,bj), sigmaR,869 I rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR, 946 870 I bi, bj, myTime, myIter, myThid ) 947 871 #ifdef SALT_PLUME_VOLUME … … 950 874 C-- get forcings for kpp 951 875 CALL SALT_PLUME_APPLY( 952 I 1, bi, bj, recip_hFacC(1-OLx,1-OLy, 1,bi,bj),876 I 1, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj), 953 877 I theta, 0, 954 878 I myTime, myIter, myThid ) 955 879 CALL SALT_PLUME_APPLY( 956 I 2, bi, bj, recip_hFacC(1-OLx,1-OLy, 1,bi,bj),880 I 2, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj), 957 881 I salt, 0, 958 882 I myTime, myIter, myThid ) … … 978 902 cph needed for KPP 979 903 CADJ STORE surfaceForcingU(:,:,bi,bj) 980 CADJ & = comlev1_bibj, key=itdkey, 981 CADJ & kind = isbyte 904 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 982 905 CADJ STORE surfaceForcingV(:,:,bi,bj) 983 CADJ & = comlev1_bibj, key=itdkey, 984 CADJ & kind = isbyte 906 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 985 907 CADJ STORE surfaceForcingS(:,:,bi,bj) 986 CADJ & = comlev1_bibj, key=itdkey, 987 CADJ & kind = isbyte 908 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 988 909 CADJ STORE surfaceForcingT(:,:,bi,bj) 989 CADJ & = comlev1_bibj, key=itdkey, 990 CADJ & kind = isbyte 991 CADJ STORE surfaceForcingTice(:,:,bi,bj) 992 CADJ & = comlev1_bibj, key=itdkey, 993 CADJ & kind = isbyte 910 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 994 911 #endif /* ALLOW_AUTODIFF_TAMC */ 995 912 … … 1047 964 #ifdef ALLOW_GGL90 1048 965 #ifdef ALLOW_AUTODIFF_TAMC 1049 CADJ STORE GGL90TKE (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,1050 CADJ & kind =isbyte966 CADJ STORE GGL90TKE(:,:,:,bi,bj) 967 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 1051 968 #endif /* ALLOW_AUTODIFF_TAMC */ 1052 969 C-- Compute GGL90 mixing coefficients 1053 IF ( useGGL90) THEN970 IF ( useGGL90 .AND. Nr.GT.1 ) THEN 1054 971 #ifdef ALLOW_DEBUG 1055 972 IF (debugMode) CALL DEBUG_CALL('GGL90_CALC',myThid) … … 1079 996 cph keep it although TAF says you dont need to. 1080 997 cph but I have avoided the #ifdef for now, in case more things change 1081 CADJ STORE sigmaX(:,:,:) = comlev1_bibj, key=itdkey, 1082 CADJ & kind = isbyte 1083 CADJ STORE sigmaY(:,:,:) = comlev1_bibj, key=itdkey, 1084 CADJ & kind = isbyte 1085 CADJ STORE sigmaR(:,:,:) = comlev1_bibj, key=itdkey, 1086 CADJ & kind = isbyte 998 CADJ STORE sigmaX(:,:,:) = comlev1_bibj, key=itdkey, kind=isbyte 999 CADJ STORE sigmaY(:,:,:) = comlev1_bibj, key=itdkey, kind=isbyte 1000 CADJ STORE sigmaR(:,:,:) = comlev1_bibj, key=itdkey, kind=isbyte 1087 1001 # endif 1088 1002 #endif /* ALLOW_AUTODIFF_TAMC */ … … 1166 1080 #endif /* ALLOW_KPP */ 1167 1081 1082 #ifdef ALLOW_GGL90 1083 IF ( useGGL90 ) 1084 & CALL GGL90_EXCHANGES( myThid ) 1085 #endif /* ALLOW_GGL90 */ 1086 1168 1087 #ifdef ALLOW_DIAGNOSTICS 1169 1088 IF ( fluidIsWater .AND. useDiagnostics ) THEN -
issm/trunk-jpl/test/MITgcm/code/eeboot_minimal.F
r23083 r26544 40 40 INTEGER myComm 41 41 42 C !FUNCTIONS: 43 c INTEGER IFNBLNK 44 c EXTERNAL IFNBLNK 45 INTEGER ILNBLNK 46 EXTERNAL ILNBLNK 47 42 48 C !LOCAL VARIABLES: 43 49 C == Local variables == … … 58 64 LOGICAL doReport 59 65 #if defined(ALLOW_OASIS) || defined(COMPONENT_MODULE) 60 INTEGER mpiMyWid 66 INTEGER mpiMyWId 67 #elif defined(ALLOW_NEST2W_COMMON) 68 INTEGER mpiMyWId 61 69 #endif 62 70 #ifdef ALLOW_CPL_ISSM … … 67 75 #endif /* ALLOW_CPL_ISSM */ 68 76 #if defined(ALLOW_NEST_PARENT) || defined(ALLOW_NEST_CHILD) 69 INTEGER mpiMyW id, color77 INTEGER mpiMyWId, color 70 78 #endif 71 79 #ifdef USE_PDAF 72 80 INTEGER mpi_task_id 81 CHARACTER*(14) fmtStr 82 #else 83 CHARACTER*(6) fmtStr 73 84 #endif /* USE_PDAF */ 85 INTEGER iTmp 74 86 #endif /* ALLOW_USE_MPI */ 75 87 CEOP … … 176 188 #endif /* ALLOW_NEST_PARENT | ALLOW_NEST_CHILD */ 177 189 190 #ifdef ALLOW_NEST2W_COMMON 191 C-- Case with 2-Ways Nest(ing) 192 C- Set the running directory 193 CALL MPI_COMM_RANK( MPI_COMM_WORLD, mpiMyWId, mpiRC ) 194 CALL SETDIR( mpiMyWId ) 195 196 C- Setup Nesting Execution Environment 197 CALL NEST2W_EEINIT( mpiMyWId ) 198 IF ( eeBootError ) GOTO 999 199 #endif /* ALLOW_NEST2W_COMMON */ 200 178 201 #ifdef ALLOW_CPL_ISSM 179 202 C add a 1rst preliminary call EESET_PARAMS to set useCoupler … … 216 239 ENDIF 217 240 myProcId = mpiMyId 241 iTmp = MAX(4,1 + INT(LOG10(DFLOAT(nPx*nPy)))) 218 242 #ifdef USE_PDAF 219 WRITE(myProcessStr,'(I4.4,A1,I4.4)') mpi_task_id,'.',myProcId 243 WRITE(fmtStr,'(4(A,I1),A)') 244 & '(I',iTmp,'.',iTmp,',A1,I',iTmp,'.',iTmp,')' 245 WRITE(myProcessStr,fmtStr) mpi_task_id,'.',myProcId 220 246 #else 221 WRITE(myProcessStr,'(I4.4)') myProcId 247 WRITE(fmtStr,'(2(A,I1),A)') '(I',iTmp,'.',iTmp,')' 248 WRITE(myProcessStr,fmtStr) myProcId 222 249 #endif /* USE_PDAF */ 250 iTmp = ILNBLNK( myProcessStr ) 223 251 mpiPidIo = myProcId 224 252 pidIO = mpiPidIo … … 227 255 IF( myProcId .EQ. 0 ) THEN 228 256 #endif 229 WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:4) 230 #ifdef USE_PDAF 231 WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:9) 232 #endif 257 WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:iTmp) 233 258 OPEN(errorMessageUnit,FILE=fNam,STATUS='unknown') 234 WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:4) 235 #ifdef USE_PDAF 236 WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:9) 237 #endif 259 WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:iTmp) 238 260 OPEN(standardMessageUnit,FILE=fNam,STATUS='unknown') 239 261 #ifdef SINGLE_DISK_IO -
issm/trunk-jpl/test/MITgcm/code/packages.conf
r26542 r26544 1 #-- list of packages (or group of packages) to compile for this experiment: 1 2 gfd 3 obcs 4 shelfice 5 diagnostics 2 6 timeave 3 shelfice4 obcs5 diagnostics -
issm/trunk-jpl/test/MITgcm/code_4003/CPP_EEOPTIONS.h
r24121 r26544 62 62 C Use D0 where it means REAL*8 but not where it means REAL*16 63 63 #define D0 d0 64 65 C-- Enable some old macro conventions for backward compatibility66 #undef USE_OLD_MACROS_R4R8toRSRL67 64 68 65 C=== IO related options === -
issm/trunk-jpl/test/MITgcm/code_4003/CPP_OPTIONS.h
r24121 r26544 54 54 #define INCLUDE_PHIHYD_CALCULATION_CODE 55 55 56 C o Include/exclude sound speed calculation code 57 C o (Note that this is a diagnostic from Del Grasso algorithm, not derived from EOS) 58 #undef INCLUDE_SOUNDSPEED_CALC_CODE 59 56 60 C-- Vertical mixing code options: 57 61 … … 74 78 #undef EXCLUDE_PCELL_MIX_CODE 75 79 80 C o Exclude/allow to use isotropic 3-D Smagorinsky viscosity as diffusivity 81 C for tracers (after scaling by constant Prandtl number) 82 #undef ALLOW_SMAG_3D_DIFFUSIVITY 83 76 84 C-- Time-stepping code options: 77 85 78 86 C o Include/exclude combined Surf.Pressure and Drag Implicit solver code 79 # undefALLOW_SOLVE4_PS_AND_DRAG87 #define ALLOW_SOLVE4_PS_AND_DRAG 80 88 81 89 C o Include/exclude Implicit vertical advection code … … 84 92 C o Include/exclude AdamsBashforth-3rd-Order code 85 93 #undef ALLOW_ADAMSBASHFORTH_3 94 95 C o Include/exclude Quasi-Hydrostatic Stagger Time-step AdamsBashforth code 96 #undef ALLOW_QHYD_STAGGER_TS 86 97 87 98 C-- Model formulation options: … … 94 105 C this implies that grid-cell thickness (hFactors) varies with time 95 106 #define NONLIN_FRSURF 107 C o Disable code for rStar coordinate and/or code for Sigma coordinate 108 c#define DISABLE_RSTAR_CODE 109 c#define DISABLE_SIGMA_CODE 96 110 97 111 C o Include/exclude nonHydrostatic code … … 103 117 C-- Algorithm options: 104 118 105 C o UseNon Self-Adjoint (NSA) conjugate-gradient solver119 C o Include/exclude code for Non Self-Adjoint (NSA) conjugate-gradient solver 106 120 #undef ALLOW_CG2D_NSA 107 121 108 122 C o Include/exclude code for single reduction Conjugate-Gradient solver 109 # undefALLOW_SRCG123 #define ALLOW_SRCG 110 124 111 125 C o Choices for implicit solver routines solve_*diagonal.F 112 126 C The following has low memory footprint, but not suitable for AD 113 # undefSOLVE_DIAGONAL_LOWMEMORY127 #define SOLVE_DIAGONAL_LOWMEMORY 114 128 C The following one suitable for AD but does not vectorize 115 129 #undef SOLVE_DIAGONAL_KINNER … … 117 131 C-- Retired code options: 118 132 133 C o ALLOW isotropic scaling of harmonic and bi-harmonic terms when 134 C using an locally isotropic spherical grid with (dlambda) x (dphi*cos(phi)) 135 C *only for use on a lat-lon grid* 136 C Setting this flag here affects both momentum and tracer equation unless 137 C it is set/unset again in other header fields (e.g., GAD_OPTIONS.h). 138 C The definition of the flag is commented to avoid interference with 139 C such other header files. 140 C The preferred method is specifying a value for viscAhGrid or viscA4Grid 141 C in data which is then automatically scaled by the grid size; 142 C the old method of specifying viscAh/viscA4 and this flag is provided 143 C for completeness only (and for use with the adjoint). 144 c#define ISOTROPIC_COS_SCALING 145 146 C o This flag selects the form of COSINE(lat) scaling of bi-harmonic term. 147 C *only for use on a lat-lon grid* 148 C Has no effect if ISOTROPIC_COS_SCALING is undefined. 149 C Has no effect on vector invariant momentum equations. 150 C Setting this flag here affects both momentum and tracer equation unless 151 C it is set/unset again in other header fields (e.g., GAD_OPTIONS.h). 152 C The definition of the flag is commented to avoid interference with 153 C such other header files. 154 c#define COSINEMETH_III 155 156 C o Use "OLD" UV discretisation near boundaries (*not* recommended) 157 C Note - only works with pkg/mom_fluxform and "no_slip_sides=.FALSE." 158 C because the old code did not have no-slip BCs 159 #undef OLD_ADV_BCS 160 119 161 C o Use LONG.bin, LATG.bin, etc., initialization for ini_curviliear_grid.F 120 162 C Default is to use "new" grid files (OLD_GRID_IO undef) but OLD_GRID_IO 121 163 C is still useful with, e.g., single-domain curvilinear configurations. 122 164 #undef OLD_GRID_IO 165 166 C o Use old EXTERNAL_FORCING_U,V,T,S subroutines (for backward compatibility) 167 #undef USE_OLD_EXTERNAL_FORCING 123 168 124 169 C-- Other option files: -
issm/trunk-jpl/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h
r26543 r26544 23 23 PARAMETER( diagSt_size = 10*Nr ) 24 24 25 25 26 CEH3 ;;; Local Variables: *** 26 27 CEH3 ;;; mode:fortran *** -
issm/trunk-jpl/test/MITgcm/code_4003/DIAG_OPTIONS.h
r24121 r26544 2 2 #define DIAG_OPTIONS_H 3 3 #include "PACKAGES_CONFIG.h" 4 #ifdef ALLOW_DIAGNOSTICS5 6 4 #include "CPP_OPTIONS.h" 7 5 8 CEH3 package-specific options go here 6 #ifdef ALLOW_DIAGNOSTICS 7 C Package-specific Options & Macros go here 9 8 10 9 C allow to define specific regions and the corresponding mask ; 11 10 C used to perform regional statistics over a limited area 12 # undefDIAGSTATS_REGION_MASK11 #define DIAGSTATS_REGION_MASK 13 12 14 13 C allow to stop & restart at any time (i.e. not at a multiple of … … 19 18 #undef DIAGNOSTICS_HAS_PICKUP 20 19 21 C for NetCDF (mnc) output: define a missing value (default is UNSET_RL)22 C and fill land points of (so far only) scalar fields with it23 #undef DIAGNOSTICS_MISSING_VALUE24 25 20 #endif /* ALLOW_DIAGNOSTICS */ 26 21 #endif /* DIAG_OPTIONS_H */ 27 28 22 29 23 CEH3 ;;; Local Variables: *** -
issm/trunk-jpl/test/MITgcm/code_4003/OBCS_OPTIONS.h
r24121 r26544 1 1 C CPP options file for OBCS package 2 C3 2 C Use this file for selecting options within the OBCS package 4 C5 C OBCS is enabled with ALLOW_OBCS in CPP_OPTIONS.h6 3 7 4 #ifndef OBCS_OPTIONS_H … … 11 8 12 9 #ifdef ALLOW_OBCS 10 C Package-specific Options & Macros go here 13 11 14 12 C Enable individual open boundaries … … 25 23 #define ALLOW_OBCS_PRESCRIBE 26 24 27 C This includes hooks to sponge layer treatment of uvel, vvel 25 C Enable OB conditions following Stevens (1990) 26 #undef ALLOW_OBCS_STEVENS 27 28 C Allow sponge layer treatment of open boundary conditions 28 29 #define ALLOW_OBCS_SPONGE 29 30 31 C Include hooks to sponge layer treatment of pkg/seaice variables 32 #undef ALLOW_OBCS_SEAICE_SPONGE 33 30 34 C balance barotropic velocity 31 C KS16 turn this on32 35 #define ALLOW_OBCS_BALANCE 33 36 37 C add tidal contributions to normal OB flow 38 C NOTE that at the moment tidal forcing is applied 39 C only to "normal" flow. 40 #undef ALLOW_OBCS_TIDES 41 42 C Use older implementation of obcs in seaice-dynamics 43 C note: most of the "experimental" options listed below have not yet 44 C been implementated in new version. 45 #undef OBCS_UVICE_OLD 46 47 #ifdef OBCS_UVICE_OLD 34 48 C The following five CPP options are experimental and aim to deal 35 49 C with artifacts due to the low-frequency specification of sea-ice … … 46 60 #undef OBCS_SEAICE_SMOOTH_UVICE_PAR 47 61 62 C Compute rather than specify seaice velocities at the edges. 63 #undef OBCS_SEAICE_COMPUTE_UVICE 64 #endif /* OBCS_UVICE_OLD */ 65 48 66 C Smooth the tracer sea-ice variables near the edges. 49 67 #undef OBCS_SEAICE_SMOOTH_EDGE 50 68 51 C Compute rather than specify seaice velocities at the edges.52 #undef OBCS_SEAICE_COMPUTE_UVICE53 54 69 #endif /* ALLOW_OBCS */ 55 70 #endif /* OBCS_OPTIONS_H */ -
issm/trunk-jpl/test/MITgcm/code_4003/SIZE.h
r26542 r26544 43 43 INTEGER Nr 44 44 PARAMETER ( 45 & sNx = 3,46 & sNy = 200,45 & sNx = 1, 46 & sNy = 50, 47 47 & OLx = 3, 48 48 & OLy = 3, 49 49 & nSx = 1, 50 & nSy = 1,50 & nSy = 4, 51 51 & nPx = 1, 52 52 & nPy = 1, -
issm/trunk-jpl/test/MITgcm/code_4003/do_oceanic_phys.F
r24121 r26544 1 1 #include "PACKAGES_CONFIG.h" 2 2 #include "CPP_OPTIONS.h" 3 #ifdef ALLOW_MOM_COMMON 4 # include "MOM_COMMON_OPTIONS.h" 5 #endif 3 6 #ifdef ALLOW_AUTODIFF 4 7 # include "AUTODIFF_OPTIONS.h" … … 73 76 C |-- EXTERNAL_FORCING_SURF 74 77 C | 78 C |-- OBCS_ADJUST 79 C | 75 80 C |- k loop (Nr:1): 76 81 C | - DWNSLP_CALC_RHO … … 119 124 C | 120 125 C |-- KPP_DO_EXCH 126 C | 127 C |-- GGL90_EXCHANGES 121 128 C | 122 129 C |-- DIAGS_RHO_G … … 143 150 #ifdef ALLOW_AUTODIFF 144 151 # include "AUTODIFF_MYFIELDS.h" 145 # include "tamc.h" 146 # include "tamc_keys.h" 152 # ifdef ALLOW_AUTODIFF_TAMC 153 # include "tamc.h" 154 # endif 147 155 # include "FFIELDS.h" 148 156 # include "SURFACE.h" … … 196 204 C !LOCAL VARIABLES: 197 205 C == Local variables 198 C rhoK , rhoKm1 :: Density at current level, and level above206 C rhoKp1,rhoKm1 :: Density at current level, and @ level minus one 199 207 C iMin, iMax :: Ranges and sub-block indices on which calculations 200 208 C jMin, jMax are applied. … … 202 210 C msgBuf :: Temp. for building output string 203 211 C i,j,k :: loop indices 212 C kSrf :: surface index 204 213 _RL rhoKp1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy) 205 214 _RL rhoKm1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy) … … 210 219 INTEGER jMin, jMax 211 220 INTEGER bi, bj 212 INTEGER i, j, k 221 INTEGER i, j, k, kSrf 213 222 CHARACTER*(MAX_LEN_MBUF) msgBuf 214 223 INTEGER doDiagsRho … … 221 230 _RL thetaRef 222 231 #endif /* ALLOW_AUTODIFF */ 232 #ifdef ALLOW_AUTODIFF_TAMC 233 INTEGER act1, act2, act3, act4 234 INTEGER max1, max2, max3 235 INTEGER kkey, itdkey 236 #endif 223 237 CEOP 224 238 … … 227 241 itdkey = 1 228 242 #endif /* ALLOW_AUTODIFF_TAMC */ 243 244 kSrf = 1 245 IF ( usingPCoords ) kSrf = Nr 229 246 230 247 #ifdef ALLOW_DEBUG … … 282 299 283 300 #ifdef ALLOW_AUTODIFF 284 # ifdef ALLOW_SALT_PLUME285 301 DO bj=myByLo(myThid),myByHi(myThid) 286 302 DO bi=myBxLo(myThid),myBxHi(myThid) 287 303 DO j=1-OLy,sNy+OLy 288 304 DO i=1-OLx,sNx+OLx 305 adjustColdSST_diag(i,j,bi,bj) = 0. _d 0 306 # ifdef ALLOW_SALT_PLUME 289 307 saltPlumeDepth(i,j,bi,bj) = 0. _d 0 290 308 saltPlumeFlux(i,j,bi,bj) = 0. _d 0 309 # endif 291 310 ENDDO 292 311 ENDDO 293 312 ENDDO 294 313 ENDDO 295 # endif296 # ifdef ALLOW_ECCO297 # ifdef ALLOW_SIGMAR_COST_CONTRIBUTION298 DO bj=myByLo(myThid),myByHi(myThid)299 DO bi=myBxLo(myThid),myBxHi(myThid)300 DO k=1,Nr301 DO j=1-OLy,sNy+OLy302 DO i=1-OLx,sNx+OLx303 sigmaRfield(i,j,k,bi,bj) = 0. _d 0304 ENDDO305 ENDDO306 ENDDO307 ENDDO308 ENDDO309 # endif310 # endif311 314 #endif /* ALLOW_AUTODIFF */ 312 315 … … 320 323 #endif /* ALLOW_FRAZIL */ 321 324 322 #ifndef OLD_THSICE_CALL_SEQUENCE323 325 #if (defined ALLOW_THSICE) && !(defined ALLOW_ATM2D) 324 326 IF ( useThSIce .AND. fluidIsWater ) THEN 325 327 # ifdef ALLOW_AUTODIFF_TAMC 326 CADJ STORE uice,vice = comlev1, key = ikey_dynamics, 327 CADJ & kind = isbyte 328 CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics, 329 CADJ & kind = isbyte 330 CADJ STORE snowHeight, Tsrf = comlev1, key = ikey_dynamics, 331 CADJ & kind = isbyte 332 CADJ STORE Qice1, Qice2 = comlev1, key = ikey_dynamics, 333 CADJ & kind = isbyte 334 CADJ STORE sHeating, snowAge = comlev1, key = ikey_dynamics, 335 CADJ & kind = isbyte 336 CADJ STORE hocemxl = comlev1, key = ikey_dynamics, 337 CADJ & kind = isbyte 338 CADJ STORE icflxsw = comlev1, key = ikey_dynamics, 339 CADJ & kind = isbyte 340 CADJ STORE salt,theta = comlev1, key = ikey_dynamics, 341 CADJ & kind = isbyte 342 CADJ STORE uvel,vvel = comlev1, key = ikey_dynamics, 343 CADJ & kind = isbyte 344 CADJ STORE qnet,qsw, empmr = comlev1, key = ikey_dynamics, 345 CADJ & kind = isbyte 346 CADJ STORE atemp,aqh,precip = comlev1, key = ikey_dynamics, 347 CADJ & kind = isbyte 348 CADJ STORE swdown,lwdown = comlev1, key = ikey_dynamics, 349 CADJ & kind = isbyte 328 # ifdef ALLOW_SEAICE 329 CADJ STORE uice,vice = comlev1, key=ikey_dynamics, kind=isbyte 330 # endif 331 CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte 332 CADJ STORE snowHeight, Tsrf = comlev1, key=ikey_dynamics, kind=isbyte 333 CADJ STORE Qice1, Qice2 = comlev1, key=ikey_dynamics, kind=isbyte 334 CADJ STORE sHeating,snowAge = comlev1, key=ikey_dynamics, kind=isbyte 335 CADJ STORE hocemxl, icflxsw = comlev1, key=ikey_dynamics, kind=isbyte 336 CADJ STORE salt,theta = comlev1, key=ikey_dynamics, kind=isbyte 337 CADJ STORE uvel,vvel = comlev1, key=ikey_dynamics, kind=isbyte 338 CADJ STORE qnet,qsw, empmr = comlev1, key=ikey_dynamics, kind=isbyte 339 CADJ STORE atemp,aqh,precip = comlev1, key=ikey_dynamics, kind=isbyte 340 CADJ STORE swdown,lwdown = comlev1, key=ikey_dynamics, kind=isbyte 350 341 # ifdef NONLIN_FRSURF 351 CADJ STORE hFac_surfC = comlev1, key = ikey_dynamics, 352 CADJ & kind = isbyte 342 CADJ STORE hFac_surfC = comlev1, key=ikey_dynamics, kind=isbyte 353 343 # endif 354 344 # endif /* ALLOW_AUTODIFF_TAMC */ … … 363 353 ENDIF 364 354 #endif /* ALLOW_THSICE */ 365 #endif /* ndef OLD_THSICE_CALL_SEQUENCE */366 355 367 356 #ifdef ALLOW_SEAICE 368 # ifdef ALLOW_AUTODIFF 369 CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte 370 CADJ STORE fu,fv = comlev1, key=ikey_dynamics, kind=isbyte 371 CADJ STORE qnet = comlev1, key=ikey_dynamics, kind=isbyte 372 CADJ STORE qsw = comlev1, key=ikey_dynamics, kind=isbyte 373 CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte 374 CADJ STORE salt = comlev1, key=ikey_dynamics, kind=isbyte 357 # ifdef ALLOW_AUTODIFF_TAMC 358 CADJ STORE qnet = comlev1, key=ikey_dynamics, kind=isbyte 359 CADJ STORE qsw = comlev1, key=ikey_dynamics, kind=isbyte 360 CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte 361 CADJ STORE salt = comlev1, key=ikey_dynamics, kind=isbyte 362 CADJ STORE fu,fv = comlev1, key=ikey_dynamics, kind=isbyte 375 363 #if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP) 376 CADJ STORE evap = comlev1, key=ikey_dynamics, kind=isbyte 377 #endif 378 IF ( .NOT.useSEAICE .AND. SEAICEadjMODE .EQ. -1 ) THEN 379 CALL SEAICE_FAKE( myTime, myIter, myThid ) 380 ENDIF 381 CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte 382 CADJ STORE fu,fv = comlev1, key=ikey_dynamics, kind=isbyte 383 CADJ STORE qnet = comlev1, key=ikey_dynamics, kind=isbyte 384 CADJ STORE qsw = comlev1, key=ikey_dynamics, kind=isbyte 385 CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte 386 CADJ STORE salt = comlev1, key=ikey_dynamics, kind=isbyte 387 #if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP) 388 CADJ STORE evap = comlev1, key=ikey_dynamics, kind=isbyte 389 #endif 390 # endif /* ALLOW_AUTODIFF */ 391 #endif /* ALLOW_SEAICE */ 392 393 #ifdef ALLOW_SEAICE 364 CADJ STORE evap = comlev1, key=ikey_dynamics, kind=isbyte 365 #endif 366 # endif /* ALLOW_AUTODIFF_TAMC */ 367 #ifdef ALLOW_AUTODIFF_TAMC 368 CADJ STORE phiHydLow= comlev1, key=ikey_dynamics, byte=isbyte 369 #endif 394 370 IF ( useSEAICE ) THEN 395 371 # ifdef ALLOW_AUTODIFF_TAMC 396 cph-adj-test( 397 CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte 398 CADJ STORE hsnow = comlev1, key=ikey_dynamics, kind=isbyte 399 CADJ STORE heff = comlev1, key=ikey_dynamics, kind=isbyte 400 CADJ STORE tices = comlev1, key=ikey_dynamics, kind=isbyte 401 CADJ STORE empmr, qnet = comlev1, key=ikey_dynamics, kind=isbyte 402 CADJ STORE qsw,saltflux = comlev1, key=ikey_dynamics, kind=isbyte 403 CADJ STORE fu, fv = comlev1, key=ikey_dynamics, kind=isbyte 404 cCADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte 405 cCADJ STORE salt = comlev1, key=ikey_dynamics, kind=isbyte 406 cph-adj-test) 407 c#ifdef ALLOW_EXF 408 CADJ STORE atemp,aqh,precip = comlev1, key = ikey_dynamics, 409 CADJ & kind = isbyte 410 CADJ STORE swdown,lwdown = comlev1, key = ikey_dynamics, 411 CADJ & kind = isbyte 412 CADJ STORE evap = comlev1, key = ikey_dynamics, 413 CADJ & kind = isbyte 414 CADJ STORE uwind,vwind = comlev1, key = ikey_dynamics, 415 CADJ & kind = isbyte 416 c#endif 417 CADJ STORE uvel,vvel = comlev1, key = ikey_dynamics, 418 CADJ & kind = isbyte 419 # ifdef SEAICE_CGRID 420 CADJ STORE stressdivergencex = comlev1, key = ikey_dynamics, 421 CADJ & kind = isbyte 422 CADJ STORE stressdivergencey = comlev1, key = ikey_dynamics, 423 CADJ & kind = isbyte 424 # endif 425 # ifdef SEAICE_ALLOW_DYNAMICS 426 CADJ STORE uice = comlev1, key = ikey_dynamics, 427 CADJ & kind = isbyte 428 CADJ STORE vice = comlev1, key = ikey_dynamics, 429 CADJ & kind = isbyte 430 CADJ STORE dwatn = comlev1, key = ikey_dynamics, 431 CADJ & kind = isbyte 432 # ifdef SEAICE_ALLOW_EVP 433 CADJ STORE seaice_sigma1 = comlev1, key = ikey_dynamics, 434 CADJ & kind = isbyte 435 CADJ STORE seaice_sigma2 = comlev1, key = ikey_dynamics, 436 CADJ & kind = isbyte 437 CADJ STORE seaice_sigma12 = comlev1, key = ikey_dynamics, 438 CADJ & kind = isbyte 439 # endif 372 CADJ STORE uvel,vvel = comlev1, key=ikey_dynamics, kind=isbyte 373 CADJ STORE uice,vice = comlev1, key=ikey_dynamics, kind=isbyte 374 # ifdef ALLOW_EXF 375 CADJ STORE atemp,aqh,precip = comlev1, key=ikey_dynamics, kind=isbyte 376 CADJ STORE swdown,lwdown = comlev1, key=ikey_dynamics, kind=isbyte 377 CADJ STORE uwind,vwind = comlev1, key=ikey_dynamics, kind=isbyte 440 378 # endif 441 379 # ifdef SEAICE_VARIABLE_SALINITY 442 CADJ STORE hsalt = comlev1, key = ikey_dynamics, 443 CADJ & kind = isbyte 380 CADJ STORE hsalt = comlev1, key=ikey_dynamics, kind=isbyte 444 381 # endif 445 382 # ifdef ATMOSPHERIC_LOADING 446 CADJ STORE pload = comlev1, key = ikey_dynamics, 447 CADJ & kind = isbyte 448 CADJ STORE siceload = comlev1, key = ikey_dynamics, 449 CADJ & kind = isbyte 383 CADJ STORE pload, siceload = comlev1, key=ikey_dynamics, kind=isbyte 450 384 # endif 451 385 # ifdef NONLIN_FRSURF 452 CADJ STORE recip_hfacc = comlev1, key = ikey_dynamics, 453 CADJ & kind = isbyte 386 CADJ STORE recip_hfacc = comlev1, key=ikey_dynamics, kind=isbyte 454 387 # endif 455 388 # ifdef ANNUAL_BALANCE 456 CADJ STORE balance_itcount = comlev1, key = ikey_dynamics, 457 CADJ & kind = isbyte 389 CADJ STORE balance_itcount = comlev1, key=ikey_dynamics, kind=isbyte 458 390 # endif /* ANNUAL_BALANCE */ 459 391 # ifdef ALLOW_THSICE 460 C-- store thSIce vars before advection (called from SEAICE_MODEL) update them: 461 CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics, 462 CADJ & kind = isbyte 463 CADJ STORE snowHeight, hOceMxL = comlev1, key = ikey_dynamics, 464 CADJ & kind = isbyte 465 CADJ STORE Qice1, Qice2 = comlev1, key = ikey_dynamics, 466 CADJ & kind = isbyte 392 C-- store thSIce vars before advection (called from SEAICE_MODEL) updates them: 393 CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte 394 CADJ STORE snowHeight,hOceMxL= comlev1, key=ikey_dynamics, kind=isbyte 395 CADJ STORE Qice1, Qice2 = comlev1, key=ikey_dynamics, kind=isbyte 467 396 # endif /* ALLOW_THSICE */ 468 397 # endif /* ALLOW_AUTODIFF_TAMC */ … … 473 402 CALL SEAICE_MODEL( myTime, myIter, myThid ) 474 403 CALL TIMER_STOP ('SEAICE_MODEL [DO_OCEANIC_PHYS]', myThid) 404 # ifdef ALLOW_AUTODIFF_TAMC 405 CADJ STORE tices = comlev1, key=ikey_dynamics, kind=isbyte 406 CADJ STORE heff = comlev1, key=ikey_dynamics, kind=isbyte 407 CADJ STORE hsnow = comlev1, key=ikey_dynamics, kind=isbyte 408 CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte 409 CADJ STORE uIce = comlev1, key=ikey_dynamics, kind=isbyte 410 CADJ STORE vIce = comlev1, key=ikey_dynamics, kind=isbyte 411 # endif 475 412 # ifdef ALLOW_COST 476 413 CALL SEAICE_COST_SENSI ( myTime, myIter, myThid ) 477 414 # endif 415 # ifdef ALLOW_AUTODIFF 416 ELSEIF ( SEAICEadjMODE .EQ. -1 ) THEN 417 CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte 418 CALL SEAICE_FAKE( myTime, myIter, myThid ) 419 # endif /* ALLOW_AUTODIFF */ 478 420 ENDIF 479 421 #endif /* ALLOW_SEAICE */ … … 493 435 494 436 #ifdef ALLOW_AUTODIFF_TAMC 495 CADJ STORE sst, sss = comlev1, key = ikey_dynamics, 496 CADJ & kind = isbyte 497 CADJ STORE qsw = comlev1, key = ikey_dynamics, 498 CADJ & kind = isbyte 437 CADJ STORE sst, sss = comlev1, key=ikey_dynamics, kind=isbyte 438 CADJ STORE qsw = comlev1, key=ikey_dynamics, kind=isbyte 499 439 # ifdef ALLOW_SEAICE 500 CADJ STORE area = comlev1, key = ikey_dynamics, 501 CADJ & kind = isbyte 502 # endif 503 #endif 504 505 #ifdef OLD_THSICE_CALL_SEQUENCE 506 #if (defined ALLOW_THSICE) && !(defined ALLOW_ATM2D) 507 IF ( useThSIce .AND. fluidIsWater ) THEN 508 # ifdef ALLOW_AUTODIFF_TAMC 509 cph( 510 # ifdef NONLIN_FRSURF 511 CADJ STORE uice,vice = comlev1, key = ikey_dynamics, 512 CADJ & kind = isbyte 513 CADJ STORE salt,theta = comlev1, key = ikey_dynamics, 514 CADJ & kind = isbyte 515 CADJ STORE qnet,qsw, empmr = comlev1, key = ikey_dynamics, 516 CADJ & kind = isbyte 517 CADJ STORE hFac_surfC = comlev1, key = ikey_dynamics, 518 CADJ & kind = isbyte 519 # endif 520 # endif 521 # ifdef ALLOW_DEBUG 522 IF (debugMode) CALL DEBUG_CALL('THSICE_MAIN',myThid) 523 # endif 524 C-- Step forward Therm.Sea-Ice variables 525 C and modify forcing terms including effects from ice 526 CALL TIMER_START('THSICE_MAIN [DO_OCEANIC_PHYS]', myThid) 527 CALL THSICE_MAIN( myTime, myIter, myThid ) 528 CALL TIMER_STOP( 'THSICE_MAIN [DO_OCEANIC_PHYS]', myThid) 529 ENDIF 530 #endif /* ALLOW_THSICE */ 531 #endif /* OLD_THSICE_CALL_SEQUENCE */ 440 CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte 441 # endif 442 #endif 532 443 533 444 #ifdef ALLOW_CPL_ISSM … … 541 452 #endif 542 453 #ifdef ALLOW_AUTODIFF_TAMC 543 CADJ STORE salt, theta = comlev1, key = ikey_dynamics, 544 CADJ & kind = isbyte 545 CADJ STORE uvel, vvel = comlev1, key = ikey_dynamics, 546 CADJ & kind = isbyte 454 CADJ STORE salt, theta = comlev1, key=ikey_dynamics, kind=isbyte 455 CADJ STORE uvel, vvel = comlev1, key=ikey_dynamics, kind=isbyte 547 456 #endif 548 457 C compute temperature and (virtual) salt flux at the … … 574 483 IF ( useSALT_PLUME ) THEN 575 484 Catn: exchanging saltPlumeFlux: 576 485 CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid ) 577 486 ENDIF 578 487 #endif /* ALLOW_SALT_PLUME */ … … 581 490 IF ( allowFreezing ) THEN 582 491 #ifdef ALLOW_AUTODIFF_TAMC 583 CADJ STORE theta = comlev1, key = ikey_dynamics, 584 CADJ & kind = isbyte 492 CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte 585 493 #endif 586 494 CALL FREEZE_SURFACE( myTime, myIter, myThid ) … … 595 503 C relaxation terms, etc. 596 504 #ifdef ALLOW_AUTODIFF 597 CADJ STORE salt, theta = comlev1, key = ikey_dynamics, 598 CADJ & kind = isbyte 505 CADJ STORE salt, theta = comlev1, key=ikey_dynamics, kind=isbyte 599 506 #else /* ALLOW_AUTODIFF */ 600 507 C-- if fluid is not water, by-pass surfaceForcing, find_rho, gmredi … … 608 515 I iMin, iMax, jMin, jMax, 609 516 I myTime, myIter, myThid ) 517 518 #ifdef ALLOW_OBCS 519 IF (useOBCS) THEN 520 C-- After all surface fluxes are known apply balancing fluxes and 521 C-- apply tidal forcing to open boundaries 522 # ifdef ALLOW_DEBUG 523 IF (debugMode) CALL DEBUG_CALL('OBCS_ADJUST',myThid) 524 # endif 525 CALL OBCS_ADJUST( 526 I myTime+deltaTClock, myIter+1, myThid ) 527 ENDIF 528 #endif /* ALLOW_OBCS */ 610 529 611 530 #ifdef ALLOW_AUTODIFF_TAMC … … 645 564 sigmaY(i,j,k) = 0. _d 0 646 565 sigmaR(i,j,k) = 0. _d 0 566 #if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG)) 567 sigmaRfield(i,j,k,bi,bj) = 0. _d 0 568 #endif 647 569 ENDDO 648 570 ENDDO 649 571 ENDDO 650 572 651 #ifdef ALLOW_AUTODIFF652 573 DO j=1-OLy,sNy+OLy 653 574 DO i=1-OLx,sNx+OLx … … 656 577 ENDDO 657 578 ENDDO 579 #ifdef ALLOW_AUTODIFF 658 580 cph all the following init. are necessary for TAF 659 581 cph although some of these are re-initialised later. … … 697 619 Kwy(i,j,k,bi,bj) = 0. _d 0 698 620 Kwz(i,j,k,bi,bj) = 0. _d 0 699 # ifdef GM_NON_UNITY_DIAGONAL700 621 Kux(i,j,k,bi,bj) = 0. _d 0 701 622 Kvy(i,j,k,bi,bj) = 0. _d 0 702 # endif703 623 # ifdef GM_EXTRA_DIAGONAL 704 624 Kuz(i,j,k,bi,bj) = 0. _d 0 … … 736 656 737 657 #ifdef ALLOW_AUTODIFF_TAMC 738 CADJ STORE theta(:,:,:,bi,bj) = comlev1_bibj, key=itdkey, 739 CADJ & kind = isbyte 740 CADJ STORE salt (:,:,:,bi,bj) = comlev1_bibj, key=itdkey, 741 CADJ & kind = isbyte 658 CADJ STORE theta(:,:,:,bi,bj) = comlev1_bibj, key=itdkey, kind=isbyte 659 CADJ STORE salt (:,:,:,bi,bj) = comlev1_bibj, key=itdkey, kind=isbyte 742 660 CADJ STORE totphihyd(:,:,:,bi,bj) 743 CADJ & = comlev1_bibj, key=itdkey, 744 CADJ & kind = isbyte 661 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 745 662 # ifdef ALLOW_KPP 746 CADJ STORE uvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey, 747 CADJ & kind = isbyte 748 CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey, 749 CADJ & kind = isbyte 663 CADJ STORE uvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey, kind=isbyte 664 CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey, kind=isbyte 750 665 # endif 751 666 # ifdef ALLOW_SALT_PLUME 752 CADJ STORE saltplumedepth(:,:,bi,bj) = comlev1_bibj, key=itdkey,753 CADJ & kind =isbyte754 CADJ STORE saltplumeflux(:,:,bi,bj) = comlev1_bibj, key=itdkey,755 CADJ & kind =isbyte667 CADJ STORE saltplumedepth(:,:,bi,bj) 668 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 669 CADJ STORE saltplumeflux(:,:,bi,bj) 670 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 756 671 # endif 757 672 #endif /* ALLOW_AUTODIFF_TAMC */ … … 856 771 IF (k.GT.1) THEN 857 772 #ifdef ALLOW_AUTODIFF_TAMC 858 CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey, 859 CADJ & kind = isbyte 860 CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey, 861 CADJ & kind = isbyte 862 CADJ STORE rhokm1 (bi,bj) = comlev1_bibj_k, key=kkey, 863 CADJ & kind = isbyte 773 CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte 774 CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte 775 CADJ STORE rhokm1 (bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte 864 776 #endif /* ALLOW_AUTODIFF_TAMC */ 865 CALL FIND_RHO_2D( 777 IF ( usingZCoords ) THEN 778 DO j=jMin,jMax 779 DO i=iMin,iMax 780 rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj) 781 ENDDO 782 ENDDO 783 CALL FIND_RHO_2D( 866 784 I iMin, iMax, jMin, jMax, k, 867 785 I theta(1-OLx,1-OLy,k-1,bi,bj), … … 869 787 O rhoKm1, 870 788 I k-1, bi, bj, myThid ) 789 ELSE 790 CALL FIND_RHO_2D( 791 I iMin, iMax, jMin, jMax, k-1, 792 I theta(1-OLx,1-OLy,k,bi,bj), 793 I salt (1-OLx,1-OLy,k,bi,bj), 794 O rhoKp1, 795 I k, bi, bj, myThid ) 796 DO j=jMin,jMax 797 DO i=iMin,iMax 798 rhoKm1(i,j) = rhoInSitu(i,j,k-1,bi,bj) 799 ENDDO 800 ENDDO 801 ENDIF 871 802 ENDIF 872 803 #ifdef ALLOW_DEBUG 873 804 IF (debugMode) CALL DEBUG_CALL('GRAD_SIGMA',myThid) 874 805 #endif 875 cph Avoid variable aliasing for adjoint !!!876 DO j=jMin,jMax877 DO i=iMin,iMax878 rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)879 ENDDO880 ENDDO881 806 CALL GRAD_SIGMA( 882 807 I bi, bj, iMin, iMax, jMin, jMax, k, … … 884 809 O sigmaX, sigmaY, sigmaR, 885 810 I myThid ) 886 #ifdef ALLOW_ECCO 887 # ifdef ALLOW_SIGMAR_COST_CONTRIBUTION811 812 #if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG)) 888 813 DO j=jMin,jMax 889 814 DO i=iMin,iMax … … 891 816 ENDDO 892 817 ENDDO 893 # endif894 #endif /* ALLOW_ECCO */ 818 #endif /* ALLOW_SIGMAR_COST_CONTRIBUTION or ALLOW_LEITH_QG */ 819 895 820 #ifdef ALLOW_AUTODIFF 896 821 #ifdef GMREDI_WITH_STABLE_ADJOINT … … 929 854 #ifdef ALLOW_AUTODIFF_TAMC 930 855 CADJ STORE IVDConvCount(:,:,:,bi,bj) 931 CADJ & = comlev1_bibj, key=itdkey, 932 CADJ & kind = isbyte 856 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 933 857 #endif 934 858 … … 936 860 IF ( calcGMRedi .OR. MOD(doDiagsRho,2).EQ.1 ) THEN 937 861 CALL CALC_OCE_MXLAYER( 938 I rhoInSitu(1-OLx,1-OLy, 1,bi,bj), sigmaR,862 I rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR, 939 863 I bi, bj, myTime, myIter, myThid ) 940 864 ENDIF … … 943 867 IF ( useSALT_PLUME ) THEN 944 868 CALL SALT_PLUME_CALC_DEPTH( 945 I rhoInSitu(1-OLx,1-OLy, 1,bi,bj), sigmaR,869 I rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR, 946 870 I bi, bj, myTime, myIter, myThid ) 947 871 #ifdef SALT_PLUME_VOLUME … … 950 874 C-- get forcings for kpp 951 875 CALL SALT_PLUME_APPLY( 952 I 1, bi, bj, recip_hFacC(1-OLx,1-OLy, 1,bi,bj),876 I 1, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj), 953 877 I theta, 0, 954 878 I myTime, myIter, myThid ) 955 879 CALL SALT_PLUME_APPLY( 956 I 2, bi, bj, recip_hFacC(1-OLx,1-OLy, 1,bi,bj),880 I 2, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj), 957 881 I salt, 0, 958 882 I myTime, myIter, myThid ) … … 978 902 cph needed for KPP 979 903 CADJ STORE surfaceForcingU(:,:,bi,bj) 980 CADJ & = comlev1_bibj, key=itdkey, 981 CADJ & kind = isbyte 904 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 982 905 CADJ STORE surfaceForcingV(:,:,bi,bj) 983 CADJ & = comlev1_bibj, key=itdkey, 984 CADJ & kind = isbyte 906 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 985 907 CADJ STORE surfaceForcingS(:,:,bi,bj) 986 CADJ & = comlev1_bibj, key=itdkey, 987 CADJ & kind = isbyte 908 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 988 909 CADJ STORE surfaceForcingT(:,:,bi,bj) 989 CADJ & = comlev1_bibj, key=itdkey, 990 CADJ & kind = isbyte 991 CADJ STORE surfaceForcingTice(:,:,bi,bj) 992 CADJ & = comlev1_bibj, key=itdkey, 993 CADJ & kind = isbyte 910 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 994 911 #endif /* ALLOW_AUTODIFF_TAMC */ 995 912 … … 1047 964 #ifdef ALLOW_GGL90 1048 965 #ifdef ALLOW_AUTODIFF_TAMC 1049 CADJ STORE GGL90TKE (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,1050 CADJ & kind =isbyte966 CADJ STORE GGL90TKE(:,:,:,bi,bj) 967 CADJ & = comlev1_bibj, key=itdkey, kind=isbyte 1051 968 #endif /* ALLOW_AUTODIFF_TAMC */ 1052 969 C-- Compute GGL90 mixing coefficients 1053 IF ( useGGL90) THEN970 IF ( useGGL90 .AND. Nr.GT.1 ) THEN 1054 971 #ifdef ALLOW_DEBUG 1055 972 IF (debugMode) CALL DEBUG_CALL('GGL90_CALC',myThid) … … 1079 996 cph keep it although TAF says you dont need to. 1080 997 cph but I have avoided the #ifdef for now, in case more things change 1081 CADJ STORE sigmaX(:,:,:) = comlev1_bibj, key=itdkey, 1082 CADJ & kind = isbyte 1083 CADJ STORE sigmaY(:,:,:) = comlev1_bibj, key=itdkey, 1084 CADJ & kind = isbyte 1085 CADJ STORE sigmaR(:,:,:) = comlev1_bibj, key=itdkey, 1086 CADJ & kind = isbyte 998 CADJ STORE sigmaX(:,:,:) = comlev1_bibj, key=itdkey, kind=isbyte 999 CADJ STORE sigmaY(:,:,:) = comlev1_bibj, key=itdkey, kind=isbyte 1000 CADJ STORE sigmaR(:,:,:) = comlev1_bibj, key=itdkey, kind=isbyte 1087 1001 # endif 1088 1002 #endif /* ALLOW_AUTODIFF_TAMC */ … … 1166 1080 #endif /* ALLOW_KPP */ 1167 1081 1082 #ifdef ALLOW_GGL90 1083 IF ( useGGL90 ) 1084 & CALL GGL90_EXCHANGES( myThid ) 1085 #endif /* ALLOW_GGL90 */ 1086 1168 1087 #ifdef ALLOW_DIAGNOSTICS 1169 1088 IF ( fluidIsWater .AND. useDiagnostics ) THEN -
issm/trunk-jpl/test/MITgcm/code_4003/eeboot_minimal.F
r24121 r26544 40 40 INTEGER myComm 41 41 42 C !FUNCTIONS: 43 c INTEGER IFNBLNK 44 c EXTERNAL IFNBLNK 45 INTEGER ILNBLNK 46 EXTERNAL ILNBLNK 47 42 48 C !LOCAL VARIABLES: 43 49 C == Local variables == … … 58 64 LOGICAL doReport 59 65 #if defined(ALLOW_OASIS) || defined(COMPONENT_MODULE) 60 INTEGER mpiMyWid 66 INTEGER mpiMyWId 67 #elif defined(ALLOW_NEST2W_COMMON) 68 INTEGER mpiMyWId 61 69 #endif 62 70 #ifdef ALLOW_CPL_ISSM … … 67 75 #endif /* ALLOW_CPL_ISSM */ 68 76 #if defined(ALLOW_NEST_PARENT) || defined(ALLOW_NEST_CHILD) 69 INTEGER mpiMyW id, color77 INTEGER mpiMyWId, color 70 78 #endif 71 79 #ifdef USE_PDAF 72 80 INTEGER mpi_task_id 81 CHARACTER*(14) fmtStr 82 #else 83 CHARACTER*(6) fmtStr 73 84 #endif /* USE_PDAF */ 85 INTEGER iTmp 74 86 #endif /* ALLOW_USE_MPI */ 75 87 CEOP … … 176 188 #endif /* ALLOW_NEST_PARENT | ALLOW_NEST_CHILD */ 177 189 190 #ifdef ALLOW_NEST2W_COMMON 191 C-- Case with 2-Ways Nest(ing) 192 C- Set the running directory 193 CALL MPI_COMM_RANK( MPI_COMM_WORLD, mpiMyWId, mpiRC ) 194 CALL SETDIR( mpiMyWId ) 195 196 C- Setup Nesting Execution Environment 197 CALL NEST2W_EEINIT( mpiMyWId ) 198 IF ( eeBootError ) GOTO 999 199 #endif /* ALLOW_NEST2W_COMMON */ 200 178 201 #ifdef ALLOW_CPL_ISSM 179 202 C add a 1rst preliminary call EESET_PARAMS to set useCoupler … … 216 239 ENDIF 217 240 myProcId = mpiMyId 241 iTmp = MAX(4,1 + INT(LOG10(DFLOAT(nPx*nPy)))) 218 242 #ifdef USE_PDAF 219 WRITE(myProcessStr,'(I4.4,A1,I4.4)') mpi_task_id,'.',myProcId 243 WRITE(fmtStr,'(4(A,I1),A)') 244 & '(I',iTmp,'.',iTmp,',A1,I',iTmp,'.',iTmp,')' 245 WRITE(myProcessStr,fmtStr) mpi_task_id,'.',myProcId 220 246 #else 221 WRITE(myProcessStr,'(I4.4)') myProcId 247 WRITE(fmtStr,'(2(A,I1),A)') '(I',iTmp,'.',iTmp,')' 248 WRITE(myProcessStr,fmtStr) myProcId 222 249 #endif /* USE_PDAF */ 250 iTmp = ILNBLNK( myProcessStr ) 223 251 mpiPidIo = myProcId 224 252 pidIO = mpiPidIo … … 227 255 IF( myProcId .EQ. 0 ) THEN 228 256 #endif 229 WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:4) 230 #ifdef USE_PDAF 231 WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:9) 232 #endif 257 WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:iTmp) 233 258 OPEN(errorMessageUnit,FILE=fNam,STATUS='unknown') 234 WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:4) 235 #ifdef USE_PDAF 236 WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:9) 237 #endif 259 WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:iTmp) 238 260 OPEN(standardMessageUnit,FILE=fNam,STATUS='unknown') 239 261 #ifdef SINGLE_DISK_IO -
issm/trunk-jpl/test/MITgcm/code_4003/packages.conf
r26452 r26544 1 #-- list of packages (or group of packages) to compile for this experiment: 1 2 gfd 3 obcs 2 4 shelfice 3 obcs4 5 diagnostics -
issm/trunk-jpl/test/MITgcm/code_4003/shelfice_step_icemass.F
r26453 r26544 45 45 C i,j, bi,bj :: loop indices 46 46 INTEGER bi,bj,i,j 47 #ifdef ALLOW_CPL_ISSM 47 48 _RL issm_density 48 49 issm_density = 917. 50 #endif /* ALLOW_CPL_ISSM */ 49 51 50 52 IF ( SHELFICEMassStepping ) THEN
Note:
See TracChangeset
for help on using the changeset viewer.