Mac instructions

From krc
(Difference between revisions)
Jump to: navigation, search
 
(11 intermediate revisions by one user not shown)
Line 1: Line 1:
1: Install FORTRAN compiler.
+
'''1: Install FORTRAN compiler.'''
  
 
The preferred compiler would be gfortran found here:
 
The preferred compiler would be gfortran found here:
Line 19: Line 19:
  
  
2: Put the zipped krc file where you want it to be run from
+
'''2: Copy the zipped krc file where you want it to be run from'''
  
  
3: Unzip krc
+
'''3: Unzip krc'''
  
4: IF YOU ARE NOT USING KRC WITH DAVINCI, IGNORE THIS STEP
 
IF YOU ARE USING KRC WITH THE DAVINCI INTERFACE:
 
Some default krc variables must be modified.
 
open /krc/src/krccom.inc
 
OR/AND        krcc8m.f
 
  
Find the lines where MAXN1,MAXN2,MAXN3,MAXN4,MAXN5,MAXNH,KOMMON are defined
+
'''4: IF YOU ARE NOT USING KRC WITH DAVINCI, IGNORE THIS STEP, GO TO 5'''
and replace with:
+
  
PARAMETER (MAXN1 =1000)   ! dimension of layers
+
Double check that some default krc variables have been modified to run with the Davinci Interface
PARAMETER (MAXN2 =86400)  ! dimension of times of day: 384=24*16
+
PARAMETER (MAXN3 =16)   ! dimension of iteration days
+
PARAMETER (MAXN4 =37)   ! dimension of latitudes
+
PARAMETER (MAXN5 =2161)   ! dimension of saved seasons    #Uncomment it if necessary
+
PARAMETER (MAXNH =9600)   ! dimension of saved times of day
+
PARAMETER (KOMMON=512000000) ! 4-byte words
+
  
Save and quit
+
open /krc/src/krccom.inc
 +
OR/AND        krcc8m.f
  
5: Now go to /krc/src/cfiles and type:
+
Replace the first 37 lines with:
make
+
Usually there are some minor-looking warnings; ignore them for now
+
  
6: Now go to /krc/src/ and type:
+
  C_Titl  krcc8m.f = KRCCOM common for input and transfer variables
  make
+
Sometimes, there are some minor-looking warnings; ignore them for now
+
 
+
7: Go back to /krc/src/cfiles and type:
+
make
+
There should be no warnings this time
+
 
+
8: Go back to /krc/src/ and type:
+
make
+
There should be no warnings this time.
+
Screen should indicate " 'krc' is up to date "
+
 
+
 
+
 
+
 
+
C_Titl  krcc8m.f = KRCCOM common for input and transfer variables
+
 
  C_Limitations  
 
  C_Limitations  
      IMPLICIT NONE            ! none-the-less, try to code with usage
+
IMPLICIT NONE             ! none-the-less, try to code with usage
      INTEGER*4 MAXN1,MAXN2,MAXN3,MAXN4,MAXN5,MAXN6,MAXNH,MAXBOT
+
INTEGER*4 MAXN1,MAXN2,MAXN3,MAXN4,MAXN5,MAXN6,MAXNH,MAXBOT
    &,MAXN1P,NUMFD,NUMID,NUMLD,N4KRC,NWKRC,KOMMON,MAXN4E
+
&,MAXN1P,NUMFD,NUMID,NUMLD,N4KRC,NWKRC,KOMMON,MAXN4E,MAXFF
 
  C Here are all the dimension-defining parameters for items in any common
 
  C Here are all the dimension-defining parameters for items in any common
      PARAMETER (MAXN1 =1000)     ! dimension of layers
+
PARAMETER (MAXN1 =1000)     ! dimension of layers
      PARAMETER (MAXN2 =384*4*256) ! dimension of times of day: 384=24*16
+
PARAMETER (MAXN2 =384*4*256)  ! dimension of times of day
      PARAMETER (MAXN3 =16)     ! dimension of iteration days
+
PARAMETER (MAXN3 =16)     ! dimension of iteration days
      PARAMETER (MAXN4 =37)     ! dimension of latitudes
+
PARAMETER (MAXN4 =37)     ! dimension of latitudes
      PARAMETER (MAXN4E =38)     ! " " Even needed for LATCOM NDJ4
+
PARAMETER (MAXN4E =38)    ! " "  Even needed for LATCOM NDJ4
      PARAMETER (MAXN5 =2161)     ! dimension of saved seasons
+
PARAMETER (MAXFF=384*4*4) ! dimension of far-field times of day
      PARAMETER (MAXN6 =6)       ! dimension of saved years
+
PARAMETER (MAXN5 =2161)    ! dimension of saved seasons
      PARAMETER (MAXNH =9600)     ! dimension of saved times of day, multiple of 24
+
PARAMETER (MAXN6 =6)      ! dimension of saved years
      PARAMETER (MAXBOT=14)     ! dimension of time doublings  MUST BE EVEN
+
PARAMETER (MAXNH =86400)     ! dimension of saved times of day, multiple of 24
      PARAMETER (MAXN1P=MAXN1+1) ! dimension layer temperature points
+
PARAMETER (MAXBOT=14)      ! dimension of time doublings  MUST  BE  EVEN
      PARAMETER (NUMFD=96, NUMID=40, NUMLD=20) ! number of each type
+
PARAMETER (MAXN1P=MAXN1+1) ! dimension layer temperature points
      PARAMETER (N4KRC=NUMFD*2+NUMID+NUMLD+2*MAXN4*2+104/4) ! # of 4-byte words
+
PARAMETER (NUMFD=96, NUMID=40, NUMLD=20) ! number of each type
              ! above is size of common in 32-bit words. it MUST be even
+
PARAMETER (N4KRC=NUMFD*2+NUMID+NUMLD+2*MAXN4*2+104/4) ! # of 4-byte words
      PARAMETER (NWKRC=N4KRC/2) ! number of Real words in krccom. Used by tdisk
+
! above is size of common in 32-bit words. it  MUST  BE  EVEN
      PARAMETER (KOMMON=512000000) ! Storage used by tdisk
+
PARAMETER (NWKRC=N4KRC/2) ! number of 8-byte words in krccom. Used by tdisk
 +
PARAMETER (KOMMON=512000000) ! Storage used by tdisk
 +
INTEGER*4 N1,N2,N3,N4,N5,  N24,IIB,IC2,NRSET,NMHA              !  1:10
 +
&,NRUN,JDISK,IDOWN,I14,I15,  KPREF,K4OUT,JBARE,NMOD,IDISK2   ! 11:20
 +
&,KOLD,KVALB,KVTAU,ID24(2), KFARAC,NBKRC,NFD,NID,NLD                ! 21:30
 +
&,N1M1,NLW,JJO,KKK,N1PIB,  NCASE,J2,J3,J4,     J5            ! 31:40
 +
REAL*8 ALB,EMIS,SKRC,COND2,DENS2, PERIOD,SPHT,DENS,CABR,AMW          ! 1:10
 +
2,ABRPHA,PTOTAL,FANON,TATM,TDEEP, SPHT2,TAUD,DUSTA,TAURAT,TWILI ! 11:20
 +
3,ARC2,ARC3,SLOPE,SLOAZI,TFROST, CFROST,AFROST,FEMIS,AF1,AF2    !   :30
 +
4,FROEXT,FD32,RLAY,FLAY,CONVF, DEPTH,DRSET,PHOG,GGT,DTMAX        !   :40
 +
5,DJUL,DELJUL,SDEC,DAU,SUBS, SOLCON,GRAV,ATMCP ! :48
 +
&,HUGE,TINY,EXPMIN,FSPARE,FLOST,RGAS,TATMIN,PRES,OPACITY,TAUIR  ! :74
 +
&,TAUEFF,TATMJ,SKYFAC,TFNOW,AFNOW,PZREF,SUMF,TEQUIL,TBLOW,HOURO ! :84
 +
&,SCALEH,BETA,DJU5,DAM,EFROST,DLAT,COND,DIFFU,SCALE ! :93
 +
&,PIVAL,SIGSB,RADC      ! :96
  
 +
Save and quit
  
  
 +
'''5: Compile KRC (and PORB)'''
 +
 +
Copy these lines:
  
 
  cd src/cfiles/
 
  cd src/cfiles/
Line 99: Line 88:
 
  cd ..
 
  cd ..
 
  make
 
  make
 +
 +
There should be no warnings this time.
 +
Screen should indicate " 'krc' is up to date "
  
 
  cd ../run
 
  cd ../run
Line 108: Line 100:
  
 
  mkdir out/
 
  mkdir out/
 +
 +
 +
'''6: Input File Modification'''
 +
 +
Generally, it is a good idea to assign no layering by default. To do this, open /master.inp and set '''IC2 to 999'''

Latest revision as of 21:32, 8 January 2019

1: Install FORTRAN compiler.

The preferred compiler would be gfortran found here: http://gcc.gnu.org/wiki/GFortranBinaries#MacOS OR http://hpc.sourceforge.net

Recently, it appears that XCode has come with all the necessary libraries and compiler.

But it may or may not be required to have additional library files associated with g77. Ignore installing g77 on your first attempt to compile krc on a mac, but compile g77 if errors associated with missing library files show up during the compilation. http://www.webmo.net/support/fortran_osx.html download the g77 compiler called g77-intel-bin.tar.gz (Intel Mac only) Then open a terminal window, go to the place where g77-intel-bin.tar.gz is located.

gunzip g77-intel-bin.tar.gz
sudo tar -xvf g77-intel-bin.tar -C /


2: Copy the zipped krc file where you want it to be run from


3: Unzip krc


4: IF YOU ARE NOT USING KRC WITH DAVINCI, IGNORE THIS STEP, GO TO 5

Double check that some default krc variables have been modified to run with the Davinci Interface

open /krc/src/krccom.inc OR/AND krcc8m.f

Replace the first 37 lines with:

C_Titl  krcc8m.f = KRCCOM common for input and transfer variables
C_Limitations 
IMPLICIT NONE             ! none-the-less, try to code with usage
INTEGER*4 MAXN1,MAXN2,MAXN3,MAXN4,MAXN5,MAXN6,MAXNH,MAXBOT
&,MAXN1P,NUMFD,NUMID,NUMLD,N4KRC,NWKRC,KOMMON,MAXN4E,MAXFF
C Here are all the dimension-defining parameters for items in any common
PARAMETER (MAXN1 =1000)     ! dimension of layers
PARAMETER (MAXN2 =384*4*256)  ! dimension of times of day
PARAMETER (MAXN3 =16)     ! dimension of iteration days
PARAMETER (MAXN4 =37)     ! dimension of latitudes
PARAMETER (MAXN4E =38)    ! " "  Even needed for LATCOM NDJ4
PARAMETER (MAXFF=384*4*4) ! dimension of far-field times of day
PARAMETER (MAXN5 =2161)    ! dimension of saved seasons
PARAMETER (MAXN6 =6)      ! dimension of saved years
PARAMETER (MAXNH =86400)     ! dimension of saved times of day, multiple of 24
PARAMETER (MAXBOT=14)      ! dimension of time doublings  MUST  BE  EVEN
PARAMETER (MAXN1P=MAXN1+1) ! dimension layer temperature points
PARAMETER (NUMFD=96, NUMID=40, NUMLD=20) ! number of each type
PARAMETER (N4KRC=NUMFD*2+NUMID+NUMLD+2*MAXN4*2+104/4) ! # of 4-byte words
! above is size of common in 32-bit words. it  MUST  BE  EVEN
PARAMETER (NWKRC=N4KRC/2) ! number of 8-byte words in krccom. Used by tdisk
PARAMETER (KOMMON=512000000) ! Storage used by tdisk
INTEGER*4 N1,N2,N3,N4,N5,  N24,IIB,IC2,NRSET,NMHA              !  1:10
&,NRUN,JDISK,IDOWN,I14,I15,  KPREF,K4OUT,JBARE,NMOD,IDISK2   ! 11:20
&,KOLD,KVALB,KVTAU,ID24(2), KFARAC,NBKRC,NFD,NID,NLD                ! 21:30
&,N1M1,NLW,JJO,KKK,N1PIB,  NCASE,J2,J3,J4,     J5            ! 31:40
REAL*8 ALB,EMIS,SKRC,COND2,DENS2, PERIOD,SPHT,DENS,CABR,AMW          ! 1:10
2,ABRPHA,PTOTAL,FANON,TATM,TDEEP, SPHT2,TAUD,DUSTA,TAURAT,TWILI ! 11:20
3,ARC2,ARC3,SLOPE,SLOAZI,TFROST, CFROST,AFROST,FEMIS,AF1,AF2    !   :30
4,FROEXT,FD32,RLAY,FLAY,CONVF, DEPTH,DRSET,PHOG,GGT,DTMAX        !   :40
5,DJUL,DELJUL,SDEC,DAU,SUBS, SOLCON,GRAV,ATMCP ! :48
&,HUGE,TINY,EXPMIN,FSPARE,FLOST,RGAS,TATMIN,PRES,OPACITY,TAUIR  ! :74
&,TAUEFF,TATMJ,SKYFAC,TFNOW,AFNOW,PZREF,SUMF,TEQUIL,TBLOW,HOURO ! :84
&,SCALEH,BETA,DJU5,DAM,EFROST,DLAT,COND,DIFFU,SCALE ! :93
&,PIVAL,SIGSB,RADC      ! :96

Save and quit


5: Compile KRC (and PORB)

Copy these lines:

cd src/cfiles/
make
cd ..
make
cd ./cfiles
make
cd ..
make

There should be no warnings this time. Screen should indicate " 'krc' is up to date "

cd ../run
rm krc
rm porbmn
ln -s ../src/krc
ln -s ../src/porbmn
mkdir out/


6: Input File Modification

Generally, it is a good idea to assign no layering by default. To do this, open /master.inp and set IC2 to 999

Personal tools