[1403] | 1 | ! $Id: inifis_mod.F90 2311 2015-06-25 07:45:24Z abarral $ |
---|
[2311] | 2 | MODULE inifis_mod |
---|
[524] | 3 | |
---|
[2311] | 4 | CONTAINS |
---|
| 5 | |
---|
| 6 | SUBROUTINE inifis(punjours, prad, pg, pr, pcpp) |
---|
| 7 | ! Initialize some physical constants and settings |
---|
| 8 | USE print_control_mod, ONLY: init_print_control, lunout |
---|
[1992] | 9 | IMPLICIT NONE |
---|
[1403] | 10 | |
---|
[2311] | 11 | include "YOMCST.h" |
---|
| 12 | REAL,INTENT(IN) :: prad, pg, pr, pcpp, punjours |
---|
[524] | 13 | |
---|
[1992] | 14 | CHARACTER (LEN=20) :: modname = 'inifis' |
---|
| 15 | CHARACTER (LEN=80) :: abort_message |
---|
| 16 | |
---|
[2311] | 17 | ! Initialize flags lunout, prt_level, debug |
---|
| 18 | CALL init_print_control |
---|
[1992] | 19 | |
---|
[2311] | 20 | ! suphel => initialize some physical constants (orbital parameters, |
---|
| 21 | ! geoid, gravity, thermodynamical constants, etc.) in the |
---|
| 22 | ! physics |
---|
| 23 | CALL suphel |
---|
[1992] | 24 | |
---|
[2311] | 25 | ! check that physical constants set in 'suphel' are coherent |
---|
| 26 | ! with values set in the dynamics: |
---|
| 27 | IF (rday/=punjours) THEN |
---|
| 28 | WRITE (lunout, *) 'inifis: length of day discrepancy!!!' |
---|
| 29 | WRITE (lunout, *) ' in the dynamics punjours=', punjours |
---|
| 30 | WRITE (lunout, *) ' but in the physics RDAY=', rday |
---|
| 31 | IF (abs(rday-punjours)>0.01*punjours) THEN |
---|
| 32 | ! stop here if the relative difference is more than 1% |
---|
| 33 | abort_message = 'length of day discrepancy' |
---|
| 34 | CALL abort_physic(modname, abort_message, 1) |
---|
| 35 | END IF |
---|
[1992] | 36 | END IF |
---|
[2311] | 37 | IF (rg/=pg) THEN |
---|
| 38 | WRITE (lunout, *) 'inifis: gravity discrepancy !!!' |
---|
| 39 | WRITE (lunout, *) ' in the dynamics pg=', pg |
---|
| 40 | WRITE (lunout, *) ' but in the physics RG=', rg |
---|
| 41 | IF (abs(rg-pg)>0.01*pg) THEN |
---|
| 42 | ! stop here if the relative difference is more than 1% |
---|
| 43 | abort_message = 'gravity discrepancy' |
---|
| 44 | CALL abort_physic(modname, abort_message, 1) |
---|
| 45 | END IF |
---|
| 46 | END IF |
---|
| 47 | IF (ra/=prad) THEN |
---|
| 48 | WRITE (lunout, *) 'inifis: planet radius discrepancy !!!' |
---|
| 49 | WRITE (lunout, *) ' in the dynamics prad=', prad |
---|
| 50 | WRITE (lunout, *) ' but in the physics RA=', ra |
---|
| 51 | IF (abs(ra-prad)>0.01*prad) THEN |
---|
| 52 | ! stop here if the relative difference is more than 1% |
---|
| 53 | abort_message = 'planet radius discrepancy' |
---|
| 54 | CALL abort_physic(modname, abort_message, 1) |
---|
| 55 | END IF |
---|
| 56 | END IF |
---|
| 57 | IF (rd/=pr) THEN |
---|
| 58 | WRITE (lunout, *) 'inifis: reduced gas constant discrepancy !!!' |
---|
| 59 | WRITE (lunout, *) ' in the dynamics pr=', pr |
---|
| 60 | WRITE (lunout, *) ' but in the physics RD=', rd |
---|
| 61 | IF (abs(rd-pr)>0.01*pr) THEN |
---|
| 62 | ! stop here if the relative difference is more than 1% |
---|
| 63 | abort_message = 'reduced gas constant discrepancy' |
---|
| 64 | CALL abort_physic(modname, abort_message, 1) |
---|
| 65 | END IF |
---|
| 66 | END IF |
---|
| 67 | IF (rcpd/=pcpp) THEN |
---|
| 68 | WRITE (lunout, *) 'inifis: specific heat discrepancy !!!' |
---|
| 69 | WRITE (lunout, *) ' in the dynamics pcpp=', pcpp |
---|
| 70 | WRITE (lunout, *) ' but in the physics RCPD=', rcpd |
---|
| 71 | IF (abs(rcpd-pcpp)>0.01*pcpp) THEN |
---|
| 72 | ! stop here if the relative difference is more than 1% |
---|
| 73 | abort_message = 'specific heat discrepancy' |
---|
| 74 | CALL abort_physic(modname, abort_message, 1) |
---|
| 75 | END IF |
---|
| 76 | END IF |
---|
[1992] | 77 | |
---|
[2311] | 78 | END SUBROUTINE inifis |
---|
| 79 | |
---|
| 80 | END MODULE inifis_mod |
---|