Skip to content

fortran example out of date #879

@Luwang909

Description

@Luwang909
  1. the gravity has to go.
  2. create world need more arguments

here's a working fix version

program test
use WorldBuilder

IMPLICIT NONE

  ! Declare the types which will be needed.
  REAL*8 :: temperature,x=120e3,y=500e3,z=0,depth=0,gravity = 10
  INTEGER :: composition_number = 3
  INTEGER(C_LONG) :: random_number_seed = 1
  REAL*8 :: composition
  character(len=256) :: file_name ="/Users/sushilthounaojam/Desktop/Work/SA_2/world_builder/WorldBuilder/cookbooks/3d_spherical_subduction/3d_spherical_subduction.wb"//C_NULL_CHAR
  logical(1) :: has_output_dir = .false.
  character(len=256) :: output_dir = "/Users/sushilthounaojam/Desktop/Work/SA_2"//C_NULL_CHAR
  
  ! Show how to call the functions.
  CALL create_world(cworld, file_name, has_output_dir, output_dir, random_number_seed)

  write(*, *) '2d temperature:'
  CALL temperature_2d(cworld,x,z,depth,temperature)
  write(*, *) 'temperature in Fortran = ', temperature

  write(*, *) '3d temperature:'
  CALL temperature_3d(cworld,x,y,z,depth,temperature)
  write(*, *) 'temperature in Fortran = ', temperature

    write(*, *) '2d composition:'
  CALL composition_2d(cworld,x,z,depth,composition_number,composition)
  write(*, *) 'composition in Fortran = ', composition

  write(*, *) '3d composition:'
  CALL composition_3d(cworld,x,y,z,depth,composition_number,composition)
  write(*, *) 'composition in Fortran = ', composition

  CALL release_world(cworld)
END program

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions